home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1992-10-16 | 13.9 KB | [TEXT/MPS ] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Thu Oct 15 20:17:21 1992, modified Thu Oct 15 20:17:21 1992, creator 'MPS ', type ASCII, 13463 bytes "SimpleInWindows.c" , at 0x3517 428 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [MPS ] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 11 53 69 6d 70 6c 65 | 49 6e 57 69 6e 64 6f 77 |..Simple|InWindow|
|00000010| 73 2e 63 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |s.c.....|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 01 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 34 97 00 | 00 01 ac a7 03 ba 91 a7 |.....4..|........|
|00000060| 03 ba 91 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 5d 87 00 00 |........|....]...|
|00000080| 2f 2a 20 09 0d 53 69 6d | 70 6c 65 49 6e 4d 6f 76 |/* ..Sim|pleInMov|
|00000090| 69 65 73 0d 0d 53 61 6d | 70 6c 65 20 70 72 6f 67 |ies..Sam|ple prog|
|000000a0| 72 61 6d 73 20 64 65 6d | 6f 6e 73 74 72 61 74 69 |rams dem|onstrati|
|000000b0| 6e 67 20 68 6f 77 20 74 | 6f 20 6f 70 65 6e 20 61 |ng how t|o open a|
|000000c0| 6e 64 20 64 69 73 70 6c | 61 79 0d 51 75 69 63 6b |nd displ|ay.Quick|
|000000d0| 54 69 6d 65 aa 20 4d 6f | 76 69 65 73 2e 0d 0d 53 |Time. Mo|vies...S|
|000000e0| 69 6d 70 6c 65 49 6e 57 | 69 6e 64 6f 77 73 2e 63 |impleInW|indows.c|
|000000f0| 20 66 69 6c 65 20 63 6f | 6e 74 61 69 6e 73 20 74 | file co|ntains t|
|00000100| 68 65 20 63 6f 64 65 20 | 66 6f 72 20 74 68 65 20 |he code |for the |
|00000110| 72 6f 75 74 69 6e 65 73 | 20 0d 68 61 76 69 6e 67 |routines| .having|
|00000120| 20 74 6f 20 64 6f 20 77 | 69 74 68 20 63 72 65 61 | to do w|ith crea|
|00000130| 74 69 6e 67 20 63 6c 6f | 73 69 6e 67 20 61 20 6d |ting clo|sing a m|
|00000140| 61 69 6e 74 61 69 6e 69 | 6e 67 20 6d 6f 76 69 65 |aintaini|ng movie|
|00000150| 20 77 69 6e 64 6f 77 73 | 2e 0d 0d 47 75 69 6c 6c | windows|...Guill|
|00000160| 65 72 6d 6f 20 41 2e 20 | 4f 72 74 69 7a 0d 4d 61 |ermo A. |Ortiz.Ma|
|00000170| 63 69 6e 74 6f 73 68 20 | 44 65 76 65 6c 6f 70 65 |cintosh |Develope|
|00000180| 72 20 54 65 63 68 6e 69 | 63 61 6c 20 53 75 70 70 |r Techni|cal Supp|
|00000190| 6f 72 74 0d 0d 30 38 2f | 30 37 2f 39 31 20 43 72 |ort..08/|07/91 Cr|
|000001a0| 65 61 74 65 64 20 74 68 | 65 20 66 69 6c 65 20 74 |eated th|e file t|
|000001b0| 6f 20 6d 6f 76 65 20 69 | 6e 20 74 68 65 20 77 69 |o move i|n the wi|
|000001c0| 6e 64 6f 77 20 63 61 6c | 6c 73 2e 20 41 6c 73 6f |ndow cal|ls. Also|
|000001d0| 20 61 64 64 65 64 20 63 | 6f 64 65 20 74 6f 20 73 | added c|ode to s|
|000001e0| 61 76 65 0d 74 68 65 20 | 6d 6f 76 69 65 20 6f 6e |ave.the |movie on|
|000001f0| 20 63 6c 6f 73 69 6e 67 | 20 69 66 20 63 68 61 6e | closing| if chan|
|00000200| 67 65 73 20 68 61 76 65 | 20 62 65 65 6e 20 6d 61 |ges have| been ma|
|00000210| 64 65 2e 0d 0d 30 38 2f | 32 32 2f 39 31 20 2d 2d |de...08/|22/91 --|
|00000220| 20 41 64 64 65 64 20 74 | 68 65 20 63 6f 64 65 20 | Added t|he code |
|00000230| 74 6f 20 61 63 63 6f 6d | 6f 64 61 74 65 20 74 68 |to accom|odate th|
|00000240| 65 20 66 61 63 74 20 74 | 68 61 74 20 74 68 65 20 |e fact t|hat the |
|00000250| 62 6f 75 6e 64 73 20 66 | 6f 72 20 74 68 65 20 63 |bounds f|or the c|
|00000260| 6f 6e 74 72 6f 6c 6c 65 | 72 20 6e 6f 77 20 65 6e |ontrolle|r now en|
|00000270| 63 6c 6f 73 65 20 74 68 | 65 20 77 68 6f 6c 65 20 |close th|e whole |
|00000280| 6d 6f 76 69 65 2e 0d 31 | 31 2f 31 39 2f 39 31 20 |movie..1|1/19/91 |
|00000290| 2d 2d 20 46 69 78 65 64 | 20 6d 6f 76 69 65 20 73 |-- Fixed| movie s|
|000002a0| 61 76 69 6e 67 20 63 6f | 64 65 20 74 6f 20 73 61 |aving co|de to sa|
|000002b0| 76 65 20 63 6f 72 72 65 | 63 74 6c 79 20 61 66 74 |ve corre|ctly aft|
|000002c0| 65 72 20 73 61 76 69 6e | 67 20 61 73 2e 2e 2e 0d |er savin|g as....|
|000002d0| 31 31 2f 32 31 2f 39 31 | 20 2d 2d 20 46 69 6e 69 |11/21/91| -- Fini|
|000002e0| 73 68 65 64 20 74 68 65 | 20 66 6c 61 74 74 65 6e |shed the| flatten|
|000002f0| 69 6e 67 20 63 6f 64 65 | 20 69 6e 63 6c 75 64 69 |ing code| includi|
|00000300| 6e 67 20 74 68 65 20 70 | 72 6f 67 72 65 73 73 20 |ng the p|rogress |
|00000310| 73 74 75 66 66 2e 0d 0d | 31 30 2f 30 38 2f 39 32 |stuff...|10/08/92|
|00000320| 20 2d 2d 20 41 64 64 65 | 64 20 63 6f 64 65 20 74 | -- Adde|d code t|
|00000330| 6f 20 63 68 65 63 6b 2f | 73 61 76 65 20 74 68 65 |o check/|save the|
|00000340| 20 4c 4f 4f 50 20 61 74 | 6f 6d 20 69 6e 20 74 68 | LOOP at|om in th|
|00000350| 65 20 75 73 65 72 20 64 | 61 74 61 2e 0d 31 30 2f |e user d|ata..10/|
|00000360| 30 39 2f 39 32 20 2d 2d | 20 41 64 64 65 64 20 63 |09/92 --| Added c|
|00000370| 6f 64 65 20 74 6f 20 63 | 68 65 63 6b 2f 73 61 76 |ode to c|heck/sav|
|00000380| 65 20 74 68 65 20 57 4c | 4f 43 20 61 74 6f 6d 20 |e the WL|OC atom |
|00000390| 75 73 65 64 20 74 6f 20 | 73 74 6f 72 65 20 74 68 |used to |store th|
|000003a0| 65 20 6c 61 73 74 20 70 | 6f 73 69 74 69 6f 6e 20 |e last p|osition |
|000003b0| 6f 66 20 74 68 65 20 6d | 6f 76 69 65 0d 2a 2f 0d |of the m|ovie.*/.|
|000003c0| 0d 23 69 6e 63 6c 75 64 | 65 20 3c 53 69 6d 70 6c |.#includ|e <Simpl|
|000003d0| 65 49 6e 4d 6f 76 69 65 | 2e 68 3e 0d 0d 65 78 74 |eInMovie|.h>..ext|
|000003e0| 65 72 6e 20 43 6f 6d 70 | 6f 6e 65 6e 74 20 6d 6f |ern Comp|onent mo|
|000003f0| 76 69 65 43 6f 6e 74 72 | 6f 6c 6c 65 72 43 6f 6d |vieContr|ollerCom|
|00000400| 70 6f 6e 65 6e 74 3b 0d | 65 78 74 65 72 6e 20 6c |ponent;.|extern l|
|00000410| 6f 6e 67 20 67 46 6c 61 | 74 74 65 6e 4d 6f 76 69 |ong gFla|ttenMovi|
|00000420| 65 73 3b 0d 0d 2f 2a 20 | 2a 2a 2a 2a 2a 2a 2a 2a |es;../* |********|
|00000430| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000440| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000450| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000460| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000470| 2a 20 2a 2f 0d 2f 2a 20 | 50 72 6f 63 65 64 75 72 |* */./* |Procedur|
|00000480| 65 73 20 74 68 61 74 20 | 68 61 6e 64 6c 65 20 77 |es that |handle w|
|00000490| 69 6e 64 6f 77 20 73 74 | 75 66 66 20 2a 2f 0d 0d |indow st|uff */..|
|000004a0| 42 6f 6f 6c 65 61 6e 20 | 43 72 65 61 74 65 4f 6e |Boolean |CreateOn|
|000004b0| 65 57 69 6e 64 6f 77 28 | 4d 6f 76 69 65 2c 20 53 |eWindow(|Movie, S|
|000004c0| 74 61 6e 64 61 72 64 46 | 69 6c 65 52 65 70 6c 79 |tandardF|ileReply|
|000004d0| 2c 20 73 68 6f 72 74 2c | 20 73 68 6f 72 74 29 3b |, short,| short);|
|000004e0| 0d 42 6f 6f 6c 65 61 6e | 20 49 73 41 70 70 57 69 |.Boolean| IsAppWi|
|000004f0| 6e 64 6f 77 28 57 69 6e | 64 6f 77 50 74 72 29 3b |ndow(Win|dowPtr);|
|00000500| 0d 42 6f 6f 6c 65 61 6e | 09 44 69 73 70 6f 73 65 |.Boolean|.Dispose|
|00000510| 41 6c 6c 57 69 6e 64 6f | 77 73 28 76 6f 69 64 29 |AllWindo|ws(void)|
|00000520| 3b 0d 42 6f 6f 6c 65 61 | 6e 09 44 69 73 70 6f 73 |;.Boolea|n.Dispos|
|00000530| 65 4f 6e 65 57 69 6e 64 | 6f 77 28 57 69 6e 64 6f |eOneWind|ow(Windo|
|00000540| 77 50 74 72 2c 20 73 68 | 6f 72 74 29 3b 0d 42 6f |wPtr, sh|ort);.Bo|
|00000550| 6f 6c 65 61 6e 20 53 61 | 76 65 4d 6f 76 69 65 28 |olean Sa|veMovie(|
|00000560| 20 44 6f 63 52 65 63 48 | 61 6e 64 6c 65 2c 20 73 | DocRecH|andle, s|
|00000570| 68 6f 72 74 29 3b 0d 42 | 6f 6f 6c 65 61 6e 20 44 |hort);.B|oolean D|
|00000580| 6f 53 61 76 65 28 73 68 | 6f 72 74 29 3b 0d 4f 53 |oSave(sh|ort);.OS|
|00000590| 45 72 72 20 50 75 74 4d | 6f 76 69 65 54 6f 46 69 |Err PutM|ovieToFi|
|000005a0| 6c 65 28 44 6f 63 52 65 | 63 48 61 6e 64 6c 65 2c |le(DocRe|cHandle,|
|000005b0| 20 42 6f 6f 6c 65 61 6e | 29 3b 0d 0d 65 78 74 65 | Boolean|);..exte|
|000005c0| 72 6e 20 44 69 61 6c 6f | 67 50 74 72 20 47 65 74 |rn Dialo|gPtr Get|
|000005d0| 43 65 6e 74 65 72 65 64 | 44 69 61 6c 6f 67 28 73 |Centered|Dialog(s|
|000005e0| 68 6f 72 74 2c 20 57 69 | 6e 64 6f 77 50 74 72 2c |hort, Wi|ndowPtr,|
|000005f0| 20 57 69 6e 64 6f 77 50 | 74 72 29 3b 0d 65 78 74 | WindowP|tr);.ext|
|00000600| 65 72 6e 20 76 6f 69 64 | 20 4f 75 74 6c 69 6e 65 |ern void| Outline|
|00000610| 44 69 61 6c 6f 67 49 74 | 65 6d 28 44 69 61 6c 6f |DialogIt|em(Dialo|
|00000620| 67 50 74 72 2c 20 73 68 | 6f 72 74 29 3b 0d 65 78 |gPtr, sh|ort);.ex|
|00000630| 74 65 72 6e 20 70 61 73 | 63 61 6c 20 42 6f 6f 6c |tern pas|cal Bool|
|00000640| 65 61 6e 09 6b 65 79 45 | 71 75 69 76 46 69 6c 74 |ean.keyE|quivFilt|
|00000650| 65 72 28 44 69 61 6c 6f | 67 50 74 72 2c 20 45 76 |er(Dialo|gPtr, Ev|
|00000660| 65 6e 74 52 65 63 6f 72 | 64 20 2a 2c 20 73 68 6f |entRecor|d *, sho|
|00000670| 72 74 20 2a 29 3b 0d 65 | 78 74 65 72 6e 20 42 6f |rt *);.e|xtern Bo|
|00000680| 6f 6c 65 61 6e 20 44 69 | 73 70 6c 61 79 50 75 74 |olean Di|splayPut|
|00000690| 46 69 6c 65 28 53 74 61 | 6e 64 61 72 64 46 69 6c |File(Sta|ndardFil|
|000006a0| 65 52 65 70 6c 79 20 2a | 29 3b 0d 65 78 74 65 72 |eReply *|);.exter|
|000006b0| 6e 20 52 65 63 74 09 43 | 65 6e 74 65 72 57 69 6e |n Rect.C|enterWin|
|000006c0| 64 6f 77 28 57 69 6e 64 | 6f 77 50 74 72 2c 20 57 |dow(Wind|owPtr, W|
|000006d0| 69 6e 64 6f 77 50 74 72 | 29 3b 0d 65 78 74 65 72 |indowPtr|);.exter|
|000006e0| 6e 20 4f 53 45 72 72 20 | 46 69 78 4d 6f 76 69 65 |n OSErr |FixMovie|
|000006f0| 57 69 6e 64 6f 77 28 57 | 69 6e 64 6f 77 50 74 72 |Window(W|indowPtr|
|00000700| 20 77 69 6e 64 6f 77 29 | 3b 0d 65 78 74 65 72 6e | window)|;.extern|
|00000710| 20 73 68 6f 72 74 20 47 | 65 74 46 69 6c 65 4c 6f | short G|etFileLo|
|00000720| 6f 70 53 74 61 74 65 28 | 44 6f 63 52 65 63 48 61 |opState(|DocRecHa|
|00000730| 6e 64 6c 65 20 44 6f 63 | 48 61 6e 64 6c 65 29 3b |ndle Doc|Handle);|
|00000740| 0d 65 78 74 65 72 6e 20 | 76 6f 69 64 20 53 65 74 |.extern |void Set|
|00000750| 4c 6f 6f 70 53 74 61 74 | 65 28 44 6f 63 52 65 63 |LoopStat|e(DocRec|
|00000760| 48 61 6e 64 6c 65 20 77 | 48 6e 64 6c 29 3b 0d 65 |Handle w|Hndl);.e|
|00000770| 78 74 65 72 6e 20 73 68 | 6f 72 74 20 47 65 74 43 |xtern sh|ort GetC|
|00000780| 75 72 72 65 6e 74 4c 6f | 6f 70 53 74 61 74 65 28 |urrentLo|opState(|
|00000790| 44 6f 63 52 65 63 48 61 | 6e 64 6c 65 20 77 48 6e |DocRecHa|ndle wHn|
|000007a0| 64 6c 29 3b 0d 65 78 74 | 65 72 6e 20 76 6f 69 64 |dl);.ext|ern void|
|000007b0| 20 55 70 64 61 74 65 4c | 6f 6f 70 53 74 61 74 65 | UpdateL|oopState|
|000007c0| 49 6e 66 6f 28 44 6f 63 | 52 65 63 48 61 6e 64 6c |Info(Doc|RecHandl|
|000007d0| 65 20 77 48 6e 64 6c 29 | 3b 0d 65 78 74 65 72 6e |e wHndl)|;.extern|
|000007e0| 20 76 6f 69 64 20 46 69 | 78 57 69 6e 64 6f 77 50 | void Fi|xWindowP|
|000007f0| 6f 73 69 74 69 6f 6e 28 | 57 69 6e 64 6f 77 50 74 |osition(|WindowPt|
|00000800| 72 20 77 2c 44 6f 63 52 | 65 63 48 61 6e 64 6c 65 |r w,DocR|ecHandle|
|00000810| 20 77 48 6e 64 6c 29 3b | 0d 65 78 74 65 72 6e 20 | wHndl);|.extern |
|00000820| 42 6f 6f 6c 65 61 6e 20 | 57 50 6f 73 69 74 69 6f |Boolean |WPositio|
|00000830| 6e 43 68 61 6e 67 65 64 | 28 57 69 6e 64 6f 77 50 |nChanged|(WindowP|
|00000840| 74 72 20 77 2c 44 6f 63 | 52 65 63 48 61 6e 64 6c |tr w,Doc|RecHandl|
|00000850| 65 20 44 6f 63 48 61 6e | 64 6c 65 29 3b 0d 65 78 |e DocHan|dle);.ex|
|00000860| 74 65 72 6e 20 76 6f 69 | 64 20 55 70 64 61 74 65 |tern voi|d Update|
|00000870| 57 69 6e 64 6f 77 50 6f | 73 28 76 6f 69 64 29 3b |WindowPo|s(void);|
|00000880| 0d 0d 65 78 74 65 72 6e | 20 73 68 6f 72 74 20 67 |..extern| short g|
|00000890| 55 6e 74 69 74 6c 65 64 | 43 6f 75 6e 74 3b 0d 0d |Untitled|Count;..|
|000008a0| 2f 2a 20 6f 70 65 6e 73 | 20 61 20 77 69 6e 64 6f |/* opens| a windo|
|000008b0| 77 20 66 6f 72 20 74 68 | 65 20 6d 6f 76 69 65 20 |w for th|e movie |
|000008c0| 61 6e 64 20 74 68 65 20 | 72 65 63 6f 72 64 20 74 |and the |record t|
|000008d0| 68 61 74 20 6b 65 65 70 | 73 20 74 68 65 20 6d 6f |hat keep|s the mo|
|000008e0| 76 69 65 20 70 6c 61 79 | 69 6e 67 0d 20 20 20 69 |vie play|ing. i|
|000008f0| 6e 20 74 68 65 20 77 69 | 6e 64 6f 77 20 61 73 20 |n the wi|ndow as |
|00000900| 77 65 6c 6c 20 61 73 20 | 74 68 65 20 69 6e 73 74 |well as |the inst|
|00000910| 61 6e 63 65 20 66 6f 72 | 20 74 68 65 20 70 6c 61 |ance for| the pla|
|00000920| 79 65 72 20 2a 2f 0d 42 | 6f 6f 6c 65 61 6e 20 43 |yer */.B|oolean C|
|00000930| 72 65 61 74 65 4f 6e 65 | 57 69 6e 64 6f 77 28 6d |reateOne|Window(m|
|00000940| 6f 6f 76 2c 20 66 69 6c | 65 49 6e 66 6f 2c 20 66 |oov, fil|eInfo, f|
|00000950| 69 6c 65 52 65 73 4e 75 | 6d 2c 20 6d 6f 6f 76 52 |ileResNu|m, moovR|
|00000960| 65 73 49 44 29 0d 4d 6f | 76 69 65 20 6d 6f 6f 76 |esID).Mo|vie moov|
|00000970| 3b 0d 53 74 61 6e 64 61 | 72 64 46 69 6c 65 52 65 |;.Standa|rdFileRe|
|00000980| 70 6c 79 20 66 69 6c 65 | 49 6e 66 6f 3b 0d 73 68 |ply file|Info;.sh|
|00000990| 6f 72 74 20 66 69 6c 65 | 52 65 73 4e 75 6d 3b 0d |ort file|ResNum;.|
|000009a0| 7b 0d 57 69 6e 64 6f 77 | 50 74 72 09 09 6d 79 57 |{.Window|Ptr..myW|
|000009b0| 69 6e 64 6f 77 3b 0d 52 | 65 63 74 09 09 09 6d 6f |indow;.R|ect...mo|
|000009c0| 6f 76 42 6f 78 3b 0d 44 | 6f 63 52 65 63 48 61 6e |ovBox;.D|ocRecHan|
|000009d0| 64 6c 65 09 44 6f 63 48 | 61 6e 64 6c 65 3b 0d 4d |dle.DocH|andle;.M|
|000009e0| 6f 76 69 65 43 6f 6e 74 | 72 6f 6c 6c 65 72 20 6c |ovieCont|roller l|
|000009f0| 6f 63 61 6c 43 6f 6e 74 | 72 6f 6c 6c 65 72 3b 0d |ocalCont|roller;.|
|00000a00| 50 6f 69 6e 74 20 77 68 | 65 72 65 3b 0d 4f 53 45 |Point wh|ere;.OSE|
|00000a10| 72 72 20 65 72 72 3b 0d | 42 6f 6f 6c 65 61 6e 20 |rr err;.|Boolean |
|00000a20| 65 6d 70 74 79 42 6f 78 | 20 3d 20 66 61 6c 73 65 |emptyBox| = false|
|00000a30| 3b 0d 0d 2f 2a 20 09 47 | 65 74 20 6f 75 72 20 64 |;../* .G|et our d|
|00000a40| 69 73 70 6c 61 79 20 77 | 69 6e 64 6f 77 2e 0d 2a |isplay w|indow..*|
|00000a50| 2f 0d 09 6d 79 57 69 6e | 64 6f 77 20 3d 20 47 65 |/..myWin|dow = Ge|
|00000a60| 74 4e 65 77 43 57 69 6e | 64 6f 77 28 77 69 6e 64 |tNewCWin|dow(wind|
|00000a70| 6f 77 49 44 2c 20 6e 69 | 6c 2c 20 28 57 69 6e 64 |owID, ni|l, (Wind|
|00000a80| 6f 77 50 74 72 29 20 2d | 31 29 3b 20 0d 09 0d 09 |owPtr) -|1); ....|
|00000a90| 69 66 20 28 20 6d 79 57 | 69 6e 64 6f 77 20 26 26 |if ( myW|indow &&|
|00000aa0| 20 28 44 6f 63 48 61 6e | 64 6c 65 20 3d 20 28 44 | (DocHan|dle = (D|
|00000ab0| 6f 63 52 65 63 48 61 6e | 64 6c 65 29 4e 65 77 48 |ocRecHan|dle)NewH|
|00000ac0| 61 6e 64 6c 65 28 73 69 | 7a 65 6f 66 28 44 6f 63 |andle(si|zeof(Doc|
|00000ad0| 52 65 63 29 29 29 20 29 | 20 7b 20 09 2f 2a 20 67 |Rec))) )| { ./* g|
|00000ae0| 65 74 20 73 74 6f 72 61 | 67 65 20 66 6f 72 09 09 |et stora|ge for..|
|00000af0| 09 2a 2f 0d 09 20 20 28 | 2a 44 6f 63 48 61 6e 64 |.*/.. (|*DocHand|
|00000b00| 6c 65 29 2d 3e 77 4d 6f | 76 69 65 20 3d 20 6d 6f |le)->wMo|vie = mo|
|00000b10| 6f 76 3b 09 09 09 09 09 | 2f 2a 20 6d 6f 76 69 65 |ov;.....|/* movie|
|00000b20| 09 09 09 09 09 2a 2f 0d | 09 20 20 28 2a 44 6f 63 |.....*/.|. (*Doc|
|00000b30| 48 61 6e 64 6c 65 29 2d | 3e 77 46 69 6c 65 49 6e |Handle)-|>wFileIn|
|00000b40| 66 6f 2e 73 66 72 20 3d | 20 66 69 6c 65 49 6e 66 |fo.sfr =| fileInf|
|00000b50| 6f 3b 09 09 09 2f 2a 20 | 66 69 6c 65 09 09 09 09 |o;.../* |file....|
|00000b60| 09 09 2a 2f 0d 09 20 20 | 28 2a 44 6f 63 48 61 6e |..*/.. |(*DocHan|
|00000b70| 64 6c 65 29 2d 3e 77 46 | 69 6c 65 49 6e 66 6f 2e |dle)->wF|ileInfo.|
|00000b80| 72 65 73 46 69 6c 65 20 | 3d 20 66 69 6c 65 52 65 |resFile |= fileRe|
|00000b90| 73 4e 75 6d 3b 0d 09 20 | 20 28 2a 44 6f 63 48 61 |sNum;.. | (*DocHa|
|00000ba0| 6e 64 6c 65 29 2d 3e 77 | 46 69 6c 65 49 6e 66 6f |ndle)->w|FileInfo|
|00000bb0| 2e 6d 6f 6f 76 49 44 20 | 3d 20 6d 6f 6f 76 52 65 |.moovID |= moovRe|
|00000bc0| 73 49 44 3b 0d 20 09 20 | 20 28 2a 44 6f 63 48 61 |sID;. . | (*DocHa|
|00000bd0| 6e 64 6c 65 29 2d 3e 6c | 6f 6f 70 53 74 61 74 65 |ndle)->l|oopState|
|00000be0| 20 3d 20 6e 6f 4c 6f 6f | 70 3b 20 2f 2a 20 64 65 | = noLoo|p; /* de|
|00000bf0| 66 61 75 6c 74 20 2a 2f | 0d 09 20 20 0d 20 09 20 |fault */|.. . . |
|00000c00| 20 69 66 20 28 20 6c 6f | 63 61 6c 43 6f 6e 74 72 | if ( lo|calContr|
|00000c10| 6f 6c 6c 65 72 20 3d 20 | 4f 70 65 6e 43 6f 6d 70 |oller = |OpenComp|
|00000c20| 6f 6e 65 6e 74 28 28 43 | 6f 6d 70 6f 6e 65 6e 74 |onent((C|omponent|
|00000c30| 29 6d 6f 76 69 65 43 6f | 6e 74 72 6f 6c 6c 65 72 |)movieCo|ntroller|
|00000c40| 43 6f 6d 70 6f 6e 65 6e | 74 29 20 29 20 7b 20 2f |Componen|t) ) { /|
|00000c50| 2a 20 61 6e 64 20 63 6f | 6d 70 6f 6e 65 6e 74 09 |* and co|mponent.|
|00000c60| 2a 2f 0d 09 09 28 2a 44 | 6f 63 48 61 6e 64 6c 65 |*/...(*D|ocHandle|
|00000c70| 29 2d 3e 77 50 6c 61 79 | 65 72 20 3d 20 6c 6f 63 |)->wPlay|er = loc|
|00000c80| 61 6c 43 6f 6e 74 72 6f | 6c 6c 65 72 3b 09 2f 2a |alContro|ller;./*|
|00000c90| 20 4f 70 65 6e 43 6f 6d | 70 6f 6e 65 6e 74 20 63 | OpenCom|ponent c|
|00000ca0| 61 6e 20 6d 6f 76 65 20 | 6d 65 6d 6f 72 79 20 73 |an move |memory s|
|00000cb0| 6f 20 69 74 20 6d 61 79 | 20 6e 6f 74 20 61 20 67 |o it may| not a g|
|00000cc0| 6f 6f 64 20 69 64 65 61 | 20 74 6f 20 64 65 72 65 |ood idea| to dere|
|00000cd0| 66 65 72 65 6e 63 65 20 | 74 68 65 20 68 61 6e 64 |ference |the hand|
|00000ce0| 6c 65 20 69 6e 20 74 68 | 65 20 73 61 6d 65 20 6c |le in th|e same l|
|00000cf0| 69 6e 65 20 2a 2f 0d 09 | 09 53 65 74 57 52 65 66 |ine */..|.SetWRef|
|00000d00| 43 6f 6e 28 6d 79 57 69 | 6e 64 6f 77 2c 20 28 6c |Con(myWi|ndow, (l|
|00000d10| 6f 6e 67 29 44 6f 63 48 | 61 6e 64 6c 65 29 3b 0d |ong)DocH|andle);.|
|00000d20| 09 09 0d 09 09 2f 2a 20 | 6e 6f 77 20 73 69 7a 65 |...../* |now size|
|00000d30| 20 77 69 6e 64 6f 77 20 | 61 64 64 69 6e 67 20 73 | window |adding s|
|00000d40| 6f 6d 65 20 73 70 61 63 | 65 20 61 74 20 74 68 65 |ome spac|e at the|
|00000d50| 20 62 6f 74 74 6f 6d 20 | 66 6f 72 20 63 6f 6e 74 | bottom |for cont|
|00000d60| 72 6f 6c 6c 65 72 20 2a | 2f 0d 09 09 47 65 74 4d |roller *|/...GetM|
|00000d70| 6f 76 69 65 42 6f 78 28 | 6d 6f 6f 76 2c 26 6d 6f |ovieBox(|moov,&mo|
|00000d80| 6f 76 42 6f 78 29 3b 20 | 2f 2a 20 55 73 65 20 74 |ovBox); |/* Use t|
|00000d90| 68 65 20 6d 6f 76 69 65 | 20 62 6f 78 20 74 6f 20 |he movie| box to |
|00000da0| 72 65 73 69 7a 65 20 77 | 69 6e 64 6f 77 20 2a 2f |resize w|indow */|
|00000db0| 0d 09 09 0d 09 09 77 68 | 65 72 65 2e 68 20 3d 20 |......wh|ere.h = |
|00000dc0| 6d 6f 6f 76 42 6f 78 2e | 6c 65 66 74 3b 0d 09 09 |moovBox.|left;...|
|00000dd0| 77 68 65 72 65 2e 76 20 | 3d 20 6d 6f 6f 76 42 6f |where.v |= moovBo|
|00000de0| 78 2e 74 6f 70 3b 0d 0d | 09 09 69 66 20 28 65 72 |x.top;..|..if (er|
|00000df0| 72 20 3d 20 4d 43 4e 65 | 77 41 74 74 61 63 68 65 |r = MCNe|wAttache|
|00000e00| 64 43 6f 6e 74 72 6f 6c | 6c 65 72 28 28 2a 44 6f |dControl|ler((*Do|
|00000e10| 63 48 61 6e 64 6c 65 29 | 2d 3e 77 50 6c 61 79 65 |cHandle)|->wPlaye|
|00000e20| 72 2c 20 6d 6f 6f 76 2c | 20 6d 79 57 69 6e 64 6f |r, moov,| myWindo|
|00000e30| 77 2c 20 77 68 65 72 65 | 29 20 29 0d 09 09 20 20 |w, where|) )... |
|00000e40| 44 65 62 75 67 53 74 72 | 28 22 5c 70 45 72 72 6f |DebugStr|("\pErro|
|00000e50| 72 20 61 74 20 50 54 4e | 65 77 41 74 74 61 63 68 |r at PTN|ewAttach|
|00000e60| 65 64 43 6f 6e 74 72 6f | 6c 6c 65 72 22 29 3b 0d |edContro|ller");.|
|00000e70| 09 09 09 09 20 20 0d 09 | 09 2f 2a 20 6e 6f 77 20 |.... ..|./* now |
|00000e80| 77 65 20 72 65 73 69 7a | 65 20 74 68 65 20 77 69 |we resiz|e the wi|
|00000e90| 6e 64 6f 77 20 61 63 63 | 6f 72 64 69 6e 67 20 74 |ndow acc|ording t|
|00000ea0| 6f 20 74 68 65 20 63 6f | 6e 74 72 6f 6c 6c 65 72 |o the co|ntroller|
|00000eb0| 20 73 65 74 74 69 6e 67 | 73 20 61 6e 64 20 74 68 | setting|s and th|
|00000ec0| 65 0d 09 09 20 20 20 64 | 69 6d 65 6e 73 69 6f 6e |e... d|imension|
|00000ed0| 73 20 6f 66 20 74 68 65 | 20 6d 6f 76 69 65 2e 0d |s of the| movie..|
|00000ee0| 09 09 2a 2f 0d 09 09 46 | 69 78 4d 6f 76 69 65 57 |..*/...F|ixMovieW|
|00000ef0| 69 6e 64 6f 77 28 6d 79 | 57 69 6e 64 6f 77 29 3b |indow(my|Window);|
|00000f00| 0d 09 09 0d 09 09 53 65 | 74 57 54 69 74 6c 65 28 |......Se|tWTitle(|
|00000f10| 6d 79 57 69 6e 64 6f 77 | 2c 66 69 6c 65 49 6e 66 |myWindow|,fileInf|
|00000f20| 6f 2e 73 66 46 69 6c 65 | 2e 6e 61 6d 65 29 3b 0d |o.sfFile|.name);.|
|00000f30| 09 09 09 0d 0d 09 09 53 | 65 74 50 6f 72 74 28 6d |.......S|etPort(m|
|00000f40| 79 57 69 6e 64 6f 77 29 | 3b 0d 09 09 0d 09 09 2f |yWindow)|;....../|
|00000f50| 2a 20 42 65 66 6f 72 65 | 20 77 65 20 70 6c 61 79 |* Before| we play|
|00000f60| 20 74 68 65 20 6d 6f 76 | 69 65 20 63 68 65 63 6b | the mov|ie check|
|00000f70| 20 74 68 65 20 73 74 61 | 74 65 20 6f 66 20 6c 6f | the sta|te of lo|
|00000f80| 6f 70 69 6e 67 20 61 6e | 20 73 65 74 20 69 74 20 |oping an| set it |
|00000f90| 61 63 63 6f 72 64 69 6e | 67 6c 79 20 2a 2f 0d 09 |accordin|gly */..|
|00000fa0| 09 0d 09 09 69 66 20 28 | 66 69 6c 65 52 65 73 4e |....if (|fileResN|
|00000fb0| 75 6d 20 21 3d 20 6b 4e | 6f 46 69 6c 65 4f 70 65 |um != kN|oFileOpe|
|00000fc0| 6e 29 20 7b 20 2f 2a 20 | 74 68 65 20 6d 6f 76 69 |n) { /* |the movi|
|00000fd0| 65 20 69 73 20 6e 6f 74 | 20 62 72 61 6e 64 20 6e |e is not| brand n|
|00000fe0| 65 77 20 2a 2f 0d 09 09 | 20 20 28 2a 44 6f 63 48 |ew */...| (*DocH|
|00000ff0| 61 6e 64 6c 65 29 2d 3e | 6c 6f 6f 70 53 74 61 74 |andle)->|loopStat|
|00001000| 65 20 3d 20 47 65 74 46 | 69 6c 65 4c 6f 6f 70 53 |e = GetF|ileLoopS|
|00001010| 74 61 74 65 28 44 6f 63 | 48 61 6e 64 6c 65 29 3b |tate(Doc|Handle);|
|00001020| 0d 09 09 20 20 69 66 20 | 28 28 2a 44 6f 63 48 61 |... if |((*DocHa|
|00001030| 6e 64 6c 65 29 2d 3e 6c | 6f 6f 70 53 74 61 74 65 |ndle)->l|oopState|
|00001040| 29 0d 09 09 20 20 20 20 | 53 65 74 4c 6f 6f 70 53 |)... |SetLoopS|
|00001050| 74 61 74 65 28 44 6f 63 | 48 61 6e 64 6c 65 29 3b |tate(Doc|Handle);|
|00001060| 0d 09 09 2f 2a 20 73 69 | 6e 63 65 20 77 65 20 61 |.../* si|nce we a|
|00001070| 72 65 20 68 65 72 65 20 | 77 65 20 63 61 6e 20 70 |re here |we can p|
|00001080| 6f 73 69 74 69 6f 6e 20 | 74 68 65 20 77 69 6e 64 |osition |the wind|
|00001090| 6f 77 20 61 63 63 6f 72 | 64 69 6e 67 20 74 6f 20 |ow accor|ding to |
|000010a0| 74 68 65 20 57 4c 4f 43 | 20 61 74 6f 6d 20 2a 2f |the WLOC| atom */|
|000010b0| 0d 09 09 20 20 46 69 78 | 57 69 6e 64 6f 77 50 6f |... Fix|WindowPo|
|000010c0| 73 69 74 69 6f 6e 28 6d | 79 57 69 6e 64 6f 77 2c |sition(m|yWindow,|
|000010d0| 20 44 6f 63 48 61 6e 64 | 6c 65 29 3b 0d 0d 09 09 | DocHand|le);....|
|000010e0| 7d 0d 09 09 0d 09 09 53 | 68 6f 77 57 69 6e 64 6f |}......S|howWindo|
|000010f0| 77 28 6d 79 57 69 6e 64 | 6f 77 29 3b 0d 09 09 53 |w(myWind|ow);...S|
|00001100| 65 6c 65 63 74 57 69 6e | 64 6f 77 28 6d 79 57 69 |electWin|dow(myWi|
|00001110| 6e 64 6f 77 29 3b 0d 09 | 09 0d 09 09 69 66 20 28 |ndow);..|....if (|
|00001120| 65 72 72 20 3d 20 4d 43 | 44 6f 41 63 74 69 6f 6e |err = MC|DoAction|
|00001130| 28 28 2a 44 6f 63 48 61 | 6e 64 6c 65 29 2d 3e 77 |((*DocHa|ndle)->w|
|00001140| 50 6c 61 79 65 72 2c 20 | 6d 63 41 63 74 69 6f 6e |Player, |mcAction|
|00001150| 50 6c 61 79 2c 20 28 50 | 74 72 29 30 78 30 30 30 |Play, (P|tr)0x000|
|00001160| 31 30 30 30 30 29 20 29 | 0d 09 09 20 20 44 65 62 |10000) )|... Deb|
|00001170| 75 67 53 74 72 28 22 5c | 70 45 72 72 6f 72 20 61 |ugStr("\|pError a|
|00001180| 74 20 4d 43 47 65 74 43 | 6f 6e 74 72 6f 6c 6c 65 |t MCGetC|ontrolle|
|00001190| 72 42 6f 75 6e 64 73 52 | 65 63 74 22 29 3b 0d 0d |rBoundsR|ect");..|
|000011a0| 09 09 72 65 74 75 72 6e | 20 74 72 75 65 3b 0d 20 |..return| true;. |
|000011b0| 20 20 20 20 20 7d 0d 09 | 7d 0d 09 2f 2a 20 73 6f | }..|}../* so|
|000011c0| 6d 65 74 68 69 6e 67 20 | 66 61 69 6c 65 64 20 73 |mething |failed s|
|000011d0| 6f 20 77 65 20 68 61 76 | 65 20 74 6f 20 67 65 74 |o we hav|e to get|
|000011e0| 20 72 69 64 20 6f 66 20 | 74 68 65 20 77 69 6e 64 | rid of |the wind|
|000011f0| 6f 77 20 2a 2f 0d 09 44 | 69 73 70 6f 73 65 57 69 |ow */..D|isposeWi|
|00001200| 6e 64 6f 77 28 6d 79 57 | 69 6e 64 6f 77 29 3b 0d |ndow(myW|indow);.|
|00001210| 09 72 65 74 75 72 6e 28 | 66 61 6c 73 65 29 3b 0d |.return(|false);.|
|00001220| 7d 0d 0d 2f 2a 20 72 65 | 74 75 72 6e 73 20 74 72 |}../* re|turns tr|
|00001230| 75 65 20 69 66 20 61 6c | 6c 20 77 69 6e 64 6f 77 |ue if al|l window|
|00001240| 73 20 68 61 76 65 20 62 | 65 65 6e 20 63 6c 6f 73 |s have b|een clos|
|00001250| 65 64 20 2a 2f 0d 42 6f | 6f 6c 65 61 6e 09 44 69 |ed */.Bo|olean.Di|
|00001260| 73 70 6f 73 65 41 6c 6c | 57 69 6e 64 6f 77 73 28 |sposeAll|Windows(|
|00001270| 76 6f 69 64 29 0d 7b 0d | 09 57 69 6e 64 6f 77 50 |void).{.|.WindowP|
|00001280| 74 72 09 77 69 6e 64 6f | 77 3b 0d 09 0d 09 77 68 |tr.windo|w;....wh|
|00001290| 69 6c 65 20 28 77 69 6e | 64 6f 77 20 3d 20 2a 28 |ile (win|dow = *(|
|000012a0| 57 69 6e 64 6f 77 50 74 | 72 20 2a 29 57 69 6e 64 |WindowPt|r *)Wind|
|000012b0| 6f 77 4c 69 73 74 29 20 | 7b 0d 0d 09 09 2f 2a 20 |owList) |{..../* |
|000012c0| 57 68 69 6c 65 20 77 65 | 20 68 61 76 65 20 61 20 |While we| have a |
|000012d0| 66 72 6f 6e 74 20 77 69 | 6e 64 6f 77 2c 20 74 72 |front wi|ndow, tr|
|000012e0| 79 20 63 6c 6f 73 69 6e | 67 20 69 74 2e 20 2a 2f |y closin|g it. */|
|000012f0| 0d 0d 09 09 69 66 20 28 | 21 44 69 73 70 6f 73 65 |....if (|!Dispose|
|00001300| 4f 6e 65 57 69 6e 64 6f | 77 28 77 69 6e 64 6f 77 |OneWindo|w(window|
|00001310| 2c 20 71 75 69 74 43 6f | 6d 6d 61 6e 64 29 29 20 |, quitCo|mmand)) |
|00001320| 72 65 74 75 72 6e 28 66 | 61 6c 73 65 29 3b 0d 09 |return(f|alse);..|
|00001330| 7d 0d 0d 09 72 65 74 75 | 72 6e 28 74 72 75 65 29 |}...retu|rn(true)|
|00001340| 3b 0d 7d 0d 0d 0d 2f 2a | 20 43 6c 6f 73 65 73 20 |;.}.../*| Closes |
|00001350| 6f 6e 65 20 77 69 6e 64 | 6f 77 20 2a 2f 0d 0d 42 |one wind|ow */..B|
|00001360| 6f 6f 6c 65 61 6e 09 44 | 69 73 70 6f 73 65 4f 6e |oolean.D|isposeOn|
|00001370| 65 57 69 6e 64 6f 77 28 | 77 69 6e 64 6f 77 2c 20 |eWindow(|window, |
|00001380| 63 6f 6d 6d 61 6e 64 29 | 0d 57 69 6e 64 6f 77 50 |command)|.WindowP|
|00001390| 74 72 20 77 69 6e 64 6f | 77 3b 0d 73 68 6f 72 74 |tr windo|w;.short|
|000013a0| 20 63 6f 6d 6d 61 6e 64 | 3b 0d 7b 0d 09 44 6f 63 | command|;.{..Doc|
|000013b0| 52 65 63 48 61 6e 64 6c | 65 09 77 48 6e 64 6c 3b |RecHandl|e.wHndl;|
|000013c0| 0d 0d 09 69 66 20 28 49 | 73 41 70 70 57 69 6e 64 |...if (I|sAppWind|
|000013d0| 6f 77 28 77 69 6e 64 6f | 77 29 29 20 7b 0d 09 09 |ow(windo|w)) {...|
|000013e0| 69 66 20 28 77 48 6e 64 | 6c 20 3d 20 28 44 6f 63 |if (wHnd|l = (Doc|
|000013f0| 52 65 63 48 61 6e 64 6c | 65 29 47 65 74 57 52 65 |RecHandl|e)GetWRe|
|00001400| 66 43 6f 6e 28 77 69 6e | 64 6f 77 29 29 20 7b 20 |fCon(win|dow)) { |
|00001410| 09 2f 2a 20 47 65 74 20 | 74 68 65 20 73 74 6f 72 |./* Get |the stor|
|00001420| 61 67 65 20 68 61 6e 64 | 6c 65 20 2a 2f 0d 09 09 |age hand|le */...|
|00001430| 20 20 69 66 20 28 53 61 | 76 65 4d 6f 76 69 65 28 | if (Sa|veMovie(|
|00001440| 77 48 6e 64 6c 2c 20 63 | 6f 6d 6d 61 6e 64 29 20 |wHndl, c|ommand) |
|00001450| 20 20 29 0d 09 09 20 20 | 20 20 72 65 74 75 72 6e | )... | return|
|00001460| 20 28 66 61 6c 73 65 29 | 3b 20 09 2f 2a 20 77 68 | (false)|; ./* wh|
|00001470| 6f 20 6b 6e 6f 77 73 20 | 74 68 65 20 75 73 65 72 |o knows |the user|
|00001480| 20 68 69 74 20 63 61 6e | 63 65 6c 20 6d 61 79 62 | hit can|cel mayb|
|00001490| 65 20 2a 2f 0d 0d 2f 2a | 2a 2a 2a 2a 20 09 4d 43 |e */../*|**** .MC|
|000014a0| 52 65 6d 6f 76 65 4d 6f | 76 69 65 20 67 6f 65 73 |RemoveMo|vie goes|
|000014b0| 20 61 77 61 79 2e 0d 09 | 09 20 20 4d 43 52 65 6d | away...|. MCRem|
|000014c0| 6f 76 65 4d 6f 76 69 65 | 28 28 2a 77 48 6e 64 6c |oveMovie|((*wHndl|
|000014d0| 29 2d 3e 77 50 6c 61 79 | 65 72 29 3b 0d 2a 2f 0d |)->wPlay|er);.*/.|
|000014e0| 09 09 20 20 43 6c 6f 73 | 65 43 6f 6d 70 6f 6e 65 |.. Clos|eCompone|
|000014f0| 6e 74 28 28 2a 77 48 6e | 64 6c 29 2d 3e 77 50 6c |nt((*wHn|dl)->wPl|
|00001500| 61 79 65 72 29 3b 09 09 | 09 2f 2a 20 61 6e 64 20 |ayer);..|./* and |
|00001510| 70 6c 61 79 65 72 20 69 | 6e 73 74 61 6e 63 65 09 |player i|nstance.|
|00001520| 09 2a 2f 0d 09 09 20 20 | 44 69 73 70 6f 73 65 4d |.*/... |DisposeM|
|00001530| 6f 76 69 65 28 28 2a 77 | 48 6e 64 6c 29 2d 3e 77 |ovie((*w|Hndl)->w|
|00001540| 4d 6f 76 69 65 29 3b 09 | 09 09 09 2f 2a 20 61 6e |Movie);.|.../* an|
|00001550| 64 20 67 65 74 20 72 69 | 64 20 6f 66 20 6d 6f 76 |d get ri|d of mov|
|00001560| 69 65 09 09 2a 2f 0d 09 | 09 20 20 69 66 20 28 28 |ie..*/..|. if ((|
|00001570| 2a 77 48 6e 64 6c 29 2d | 3e 77 46 69 6c 65 49 6e |*wHndl)-|>wFileIn|
|00001580| 66 6f 2e 73 66 72 2e 73 | 66 46 69 6c 65 2e 76 52 |fo.sfr.s|fFile.vR|
|00001590| 65 66 4e 75 6d 20 21 3d | 20 6b 49 6e 76 61 6c 56 |efNum !=| kInvalV|
|000015a0| 52 65 66 4e 75 6d 29 20 | 7b 0d 09 09 09 69 66 20 |RefNum) |{....if |
|000015b0| 28 43 6c 6f 73 65 4d 6f | 76 69 65 46 69 6c 65 28 |(CloseMo|vieFile(|
|000015c0| 28 2a 77 48 6e 64 6c 29 | 2d 3e 77 46 69 6c 65 49 |(*wHndl)|->wFileI|
|000015d0| 6e 66 6f 2e 72 65 73 46 | 69 6c 65 29 20 29 2f 2a |nfo.resF|ile) )/*|
|000015e0| 20 66 69 6c 65 20 6f 70 | 65 6e 2c 20 63 6c 6f 73 | file op|en, clos|
|000015f0| 65 20 69 74 09 09 2a 2f | 0d 09 09 09 20 20 44 65 |e it..*/|.... De|
|00001600| 62 75 67 53 74 72 28 22 | 5c 70 43 6c 6f 73 65 4d |bugStr("|\pCloseM|
|00001610| 6f 76 69 65 46 69 6c 65 | 20 66 61 69 6c 65 64 20 |ovieFile| failed |
|00001620| 69 6e 20 44 69 73 70 6f | 73 65 4f 6e 65 57 69 6e |in Dispo|seOneWin|
|00001630| 64 6f 77 22 29 3b 20 0d | 09 09 20 20 7d 0d 09 09 |dow"); .|.. }...|
|00001640| 20 20 44 69 73 70 6f 73 | 48 61 6e 64 6c 65 28 28 | Dispos|Handle((|
|00001650| 48 61 6e 64 6c 65 29 77 | 48 6e 64 6c 29 3b 09 09 |Handle)w|Hndl);..|
|00001660| 09 09 09 2f 2a 20 61 6e | 64 20 66 69 6e 61 6c 6c |.../* an|d finall|
|00001670| 79 20 74 68 65 20 68 61 | 6e 64 6c 65 09 2a 2f 0d |y the ha|ndle.*/.|
|00001680| 09 09 7d 0d 09 7d 0d 09 | 44 69 73 70 6f 73 65 57 |..}..}..|DisposeW|
|00001690| 69 6e 64 6f 77 28 77 69 | 6e 64 6f 77 29 3b 0d 09 |indow(wi|ndow);..|
|000016a0| 72 65 74 75 72 6e 28 74 | 72 75 65 29 3b 0d 7d 0d |return(t|rue);.}.|
|000016b0| 0d 42 6f 6f 6c 65 61 6e | 20 49 73 41 70 70 57 69 |.Boolean| IsAppWi|
|000016c0| 6e 64 6f 77 28 77 69 6e | 64 6f 77 29 0d 57 69 6e |ndow(win|dow).Win|
|000016d0| 64 6f 77 50 74 72 20 77 | 69 6e 64 6f 77 3b 0d 7b |dowPtr w|indow;.{|
|000016e0| 20 0d 09 69 66 20 28 77 | 69 6e 64 6f 77 29 0d 09 | ..if (w|indow)..|
|000016f0| 20 20 20 72 65 74 75 72 | 6e 20 28 28 28 57 69 6e | retur|n (((Win|
|00001700| 64 6f 77 50 65 65 6b 29 | 77 69 6e 64 6f 77 29 2d |dowPeek)|window)-|
|00001710| 3e 77 69 6e 64 6f 77 4b | 69 6e 64 20 3e 3d 20 75 |>windowK|ind >= u|
|00001720| 73 65 72 4b 69 6e 64 29 | 3b 0d 09 65 6c 73 65 0d |serKind)|;..else.|
|00001730| 09 20 20 72 65 74 75 72 | 6e 20 66 61 6c 73 65 3b |. retur|n false;|
|00001740| 0d 7d 0d 2f 2a 20 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |.}./* **|********|
|00001750| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001760| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001770| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001780| 2a 2a 2a 2a 2a 20 2a 2f | 0d 0d 2f 2a 20 63 68 65 |***** */|../* che|
|00001790| 63 6b 73 20 74 68 61 74 | 20 74 68 65 72 65 20 69 |cks that| there i|
|000017a0| 73 20 61 20 6d 6f 76 69 | 65 20 61 73 73 6f 63 69 |s a movi|e associ|
|000017b0| 61 74 65 64 20 77 69 74 | 68 20 74 68 65 20 66 72 |ated wit|h the fr|
|000017c0| 6f 6e 74 20 6d 6f 73 74 | 20 77 69 6e 64 6f 77 0d |ont most| window.|
|000017d0| 20 20 20 61 6e 64 20 74 | 72 69 65 73 20 74 6f 20 | and t|ries to |
|000017e0| 73 61 76 65 20 69 74 3b | 20 74 68 69 73 20 69 73 |save it;| this is|
|000017f0| 20 75 73 65 64 20 77 68 | 65 6e 20 74 68 65 20 73 | used wh|en the s|
|00001800| 61 76 65 20 6f 72 20 73 | 61 76 65 20 61 73 20 63 |ave or s|ave as c|
|00001810| 6f 6d 6d 61 6e 64 73 0d | 20 20 20 61 72 65 20 65 |ommands.| are e|
|00001820| 78 65 63 75 74 65 64 2e | 0d 20 20 20 0d 2a 2f 0d |xecuted.|. .*/.|
|00001830| 42 6f 6f 6c 65 61 6e 20 | 44 6f 53 61 76 65 28 63 |Boolean |DoSave(c|
|00001840| 6f 6d 6d 61 6e 64 29 0d | 73 68 6f 72 74 20 63 6f |ommand).|short co|
|00001850| 6d 6d 61 6e 64 3b 0d 7b | 0d 57 69 6e 64 6f 77 50 |mmand;.{|.WindowP|
|00001860| 74 72 20 77 69 6e 64 6f | 77 3b 0d 44 6f 63 52 65 |tr windo|w;.DocRe|
|00001870| 63 48 61 6e 64 6c 65 20 | 77 48 6e 64 6c 3b 0d 73 |cHandle |wHndl;.s|
|00001880| 68 6f 72 74 20 76 6f 6c | 75 6d 65 3b 0d 0d 09 69 |hort vol|ume;...i|
|00001890| 66 20 28 77 69 6e 64 6f | 77 20 3d 20 46 72 6f 6e |f (windo|w = Fron|
|000018a0| 74 57 69 6e 64 6f 77 28 | 29 29 20 7b 20 2f 2a 20 |tWindow(|)) { /* |
|000018b0| 64 6f 6e 27 74 20 62 6f | 74 68 65 72 20 69 66 20 |don't bo|ther if |
|000018c0| 6e 6f 20 6d 6f 76 69 65 | 73 20 74 6f 20 70 6c 61 |no movie|s to pla|
|000018d0| 79 20 2a 2f 0d 09 20 20 | 69 66 20 28 49 73 41 70 |y */.. |if (IsAp|
|000018e0| 70 57 69 6e 64 6f 77 28 | 77 69 6e 64 6f 77 29 20 |pWindow(|window) |
|000018f0| 26 26 20 28 77 48 6e 64 | 6c 20 3d 20 28 44 6f 63 |&& (wHnd|l = (Doc|
|00001900| 52 65 63 48 61 6e 64 6c | 65 29 47 65 74 57 52 65 |RecHandl|e)GetWRe|
|00001910| 66 43 6f 6e 28 77 69 6e | 64 6f 77 29 29 20 29 20 |fCon(win|dow)) ) |
|00001920| 7b 0d 09 20 20 20 20 69 | 66 20 28 57 50 6f 73 69 |{.. i|f (WPosi|
|00001930| 74 69 6f 6e 43 68 61 6e | 67 65 64 28 77 69 6e 64 |tionChan|ged(wind|
|00001940| 6f 77 2c 20 77 48 6e 64 | 6c 29 20 29 20 7b 20 2f |ow, wHnd|l) ) { /|
|00001950| 2a 20 64 69 72 74 79 20 | 74 68 65 20 6d 6f 76 69 |* dirty |the movi|
|00001960| 65 20 74 6f 20 73 61 76 | 65 20 74 68 65 20 70 6f |e to sav|e the po|
|00001970| 73 69 74 69 6f 6e 20 6f | 66 20 74 68 65 20 77 69 |sition o|f the wi|
|00001980| 6e 64 6f 77 20 2a 2f 0d | 09 09 20 20 76 6f 6c 75 |ndow */.|.. volu|
|00001990| 6d 65 20 3d 20 47 65 74 | 4d 6f 76 69 65 50 72 65 |me = Get|MoviePre|
|000019a0| 66 65 72 72 65 64 56 6f | 6c 75 6d 65 28 28 2a 77 |ferredVo|lume((*w|
|000019b0| 48 6e 64 6c 29 2d 3e 77 | 4d 6f 76 69 65 29 3b 0d |Hndl)->w|Movie);.|
|000019c0| 09 09 20 20 53 65 74 4d | 6f 76 69 65 50 72 65 66 |.. SetM|oviePref|
|000019d0| 65 72 72 65 64 56 6f 6c | 75 6d 65 28 28 2a 77 48 |erredVol|ume((*wH|
|000019e0| 6e 64 6c 29 2d 3e 77 4d | 6f 76 69 65 2c 20 76 6f |ndl)->wM|ovie, vo|
|000019f0| 6c 75 6d 65 2b 31 29 3b | 0d 09 09 20 20 53 65 74 |lume+1);|... Set|
|00001a00| 4d 6f 76 69 65 50 72 65 | 66 65 72 72 65 64 56 6f |MoviePre|ferredVo|
|00001a10| 6c 75 6d 65 28 28 2a 77 | 48 6e 64 6c 29 2d 3e 77 |lume((*w|Hndl)->w|
|00001a20| 4d 6f 76 69 65 2c 20 76 | 6f 6c 75 6d 65 29 3b 0d |Movie, v|olume);.|
|00001a30| 09 09 7d 0d 09 09 72 65 | 74 75 72 6e 20 53 61 76 |..}...re|turn Sav|
|00001a40| 65 4d 6f 76 69 65 28 77 | 48 6e 64 6c 2c 20 63 6f |eMovie(w|Hndl, co|
|00001a50| 6d 6d 61 6e 64 29 3b 0d | 20 20 20 20 20 20 7d 0d |mmand);.| }.|
|00001a60| 20 20 20 20 7d 0d 7d 0d | 0d 2f 2a 20 54 68 65 20 | }.}.|./* The |
|00001a70| 70 72 6f 67 72 65 73 73 | 20 70 72 6f 63 20 6c 65 |progress| proc le|
|00001a80| 74 73 20 74 68 65 20 75 | 73 65 72 20 6b 6e 6f 77 |ts the u|ser know|
|00001a90| 20 77 68 61 74 20 69 73 | 20 67 6f 69 6e 67 20 6f | what is| going o|
|00001aa0| 6e 20 77 68 69 6c 65 20 | 61 20 46 6c 61 74 74 65 |n while |a Flatte|
|00001ab0| 6e 4d 6f 76 69 65 20 63 | 61 6c 6c 0d 20 20 20 69 |nMovie c|all. i|
|00001ac0| 73 20 62 65 69 6e 67 20 | 64 6f 6e 65 2e 0d 20 20 |s being |done.. |
|00001ad0| 20 4e 6f 74 20 66 72 6f | 6d 20 4d 61 63 53 68 65 | Not fro|m MacShe|
|00001ae0| 6c 6c 2e 0d 2a 2f 0d 70 | 61 73 63 61 6c 20 4f 53 |ll..*/.p|ascal OS|
|00001af0| 45 72 72 20 66 6c 61 74 | 74 65 6e 50 72 6f 67 72 |Err flat|tenProgr|
|00001b00| 65 73 73 50 72 6f 63 28 | 4d 6f 76 69 65 20 6d 2c |essProc(|Movie m,|
|00001b10| 20 73 68 6f 72 74 20 6d | 65 73 73 61 67 65 2c 20 | short m|essage, |
|00001b20| 73 68 6f 72 74 20 6f 70 | 65 72 61 74 69 6f 6e 2c |short op|eration,|
|00001b30| 20 46 69 78 65 64 20 70 | 65 72 63 65 6e 74 2c 20 | Fixed p|ercent, |
|00001b40| 6c 6f 6e 67 20 72 65 66 | 43 6f 6e 29 0d 7b 0d 23 |long ref|Con).{.#|
|00001b50| 70 72 61 67 6d 61 20 75 | 6e 75 73 65 64 20 28 6d |pragma u|nused (m|
|00001b60| 29 0d 0d 57 69 6e 64 6f | 77 50 74 72 09 70 44 69 |)..Windo|wPtr.pDi|
|00001b70| 61 6c 6f 67 3b 0d 46 69 | 78 65 64 09 09 70 65 72 |alog;.Fi|xed..per|
|00001b80| 63 65 6e 74 46 69 78 20 | 3d 20 30 78 30 30 36 34 |centFix |= 0x0064|
|00001b90| 30 30 30 30 3b 20 20 2f | 2a 20 68 75 6e 64 72 65 |0000; /|* hundre|
|00001ba0| 64 20 69 6e 20 66 69 78 | 65 64 20 2a 2f 0d 73 68 |d in fix|ed */.sh|
|00001bb0| 6f 72 74 09 09 70 65 72 | 63 65 6e 74 53 68 6f 72 |ort..per|centShor|
|00001bc0| 74 3b 0d 52 65 63 74 09 | 09 77 69 6e 64 52 65 63 |t;.Rect.|.windRec|
|00001bd0| 74 2c 0d 09 09 09 70 72 | 6f 67 72 65 73 73 52 65 |t,....pr|ogressRe|
|00001be0| 63 74 3d 20 7b 31 30 30 | 2c 32 30 2c 31 32 30 2c |ct= {100|,20,120,|
|00001bf0| 32 30 30 7d 3b 0d 47 72 | 61 66 50 74 72 09 09 6f |200};.Gr|afPtr..o|
|00001c00| 6c 64 50 6f 72 74 3b 0d | 0d 09 69 66 20 28 6f 70 |ldPort;.|..if (op|
|00001c10| 65 72 61 74 69 6f 6e 20 | 21 3d 20 70 72 6f 67 72 |eration |!= progr|
|00001c20| 65 73 73 4f 70 46 6c 61 | 74 74 65 6e 29 09 2f 2a |essOpFla|tten)./*|
|00001c30| 20 54 68 69 73 20 73 68 | 6f 75 6c 64 20 6f 6e 6c | This sh|ould onl|
|00001c40| 79 20 62 65 20 63 61 6c | 6c 65 64 20 66 6f 72 20 |y be cal|led for |
|00001c50| 66 6c 61 74 74 65 6e 20 | 2a 2f 0d 09 20 20 72 65 |flatten |*/.. re|
|00001c60| 74 75 72 6e 20 66 65 61 | 74 75 72 65 55 6e 73 75 |turn fea|tureUnsu|
|00001c70| 70 70 6f 72 74 65 64 3b | 09 09 09 0d 09 65 6c 73 |pported;|.....els|
|00001c80| 65 09 09 09 09 09 09 09 | 09 09 09 09 2f 2a 20 4f |e.......|..../* O|
|00001c90| 4b 20 74 68 69 73 20 49 | 20 6b 6e 6f 77 20 61 62 |K this I| know ab|
|00001ca0| 6f 75 74 09 09 09 09 09 | 09 09 2a 2f 0d 09 20 20 |out.....|..*/.. |
|00001cb0| 73 77 69 74 63 68 20 28 | 6d 65 73 73 61 67 65 29 |switch (|message)|
|00001cc0| 20 7b 0d 09 20 20 20 20 | 63 61 73 65 20 6d 6f 76 | {.. |case mov|
|00001cd0| 69 65 50 72 6f 67 72 65 | 73 73 4f 70 65 6e 3a 0d |ieProgre|ssOpen:.|
|00001ce0| 09 09 20 20 53 65 74 52 | 65 63 74 28 26 77 69 6e |.. SetR|ect(&win|
|00001cf0| 64 52 65 63 74 2c 32 30 | 2c 32 30 2c 32 34 30 2c |dRect,20|,20,240,|
|00001d00| 32 30 30 29 3b 0d 09 09 | 20 20 70 44 69 61 6c 6f |200);...| pDialo|
|00001d10| 67 20 3d 20 4e 65 77 43 | 57 69 6e 64 6f 77 28 6e |g = NewC|Window(n|
|00001d20| 69 6c 2c 26 77 69 6e 64 | 52 65 63 74 2c 22 22 2c |il,&wind|Rect,"",|
|00001d30| 66 61 6c 73 65 2c 20 64 | 42 6f 78 50 72 6f 63 2c |false, d|BoxProc,|
|00001d40| 20 28 57 69 6e 64 6f 77 | 50 74 72 29 2d 31 4c 2c | (Window|Ptr)-1L,|
|00001d50| 74 72 75 65 2c 30 29 3b | 0d 09 09 20 20 43 65 6e |true,0);|... Cen|
|00001d60| 74 65 72 57 69 6e 64 6f | 77 28 70 44 69 61 6c 6f |terWindo|w(pDialo|
|00001d70| 67 2c 20 6e 69 6c 29 3b | 0d 09 09 20 20 69 66 20 |g, nil);|... if |
|00001d80| 28 70 44 69 61 6c 6f 67 | 29 20 7b 0d 09 20 20 09 |(pDialog|) {.. .|
|00001d90| 09 47 65 74 50 6f 72 74 | 28 26 6f 6c 64 50 6f 72 |.GetPort|(&oldPor|
|00001da0| 74 29 3b 0d 09 09 20 20 | 09 53 68 6f 77 57 69 6e |t);... |.ShowWin|
|00001db0| 64 6f 77 28 70 44 69 61 | 6c 6f 67 29 3b 0d 09 09 |dow(pDia|log);...|
|00001dc0| 20 20 20 20 53 65 74 50 | 6f 72 74 28 70 44 69 61 | SetP|ort(pDia|
|00001dd0| 6c 6f 67 29 3b 0d 09 09 | 09 4d 6f 76 65 54 6f 28 |log);...|.MoveTo(|
|00001de0| 33 30 2c 35 30 29 3b 0d | 09 09 09 44 72 61 77 53 |30,50);.|...DrawS|
|00001df0| 74 72 69 6e 67 28 22 5c | 70 46 6c 61 74 74 65 6e |tring("\|pFlatten|
|00001e00| 69 6e 67 20 69 6e 20 70 | 72 6f 67 72 65 73 73 20 |ing in p|rogress |
|00001e10| c9 22 29 3b 0d 09 09 20 | 20 20 20 46 72 61 6d 65 |.");... | Frame|
|00001e20| 52 65 63 74 28 26 70 72 | 6f 67 72 65 73 73 52 65 |Rect(&pr|ogressRe|
|00001e30| 63 74 29 3b 0d 09 09 20 | 20 09 2a 28 57 69 6e 64 |ct);... | .*(Wind|
|00001e40| 6f 77 50 74 72 20 2a 29 | 72 65 66 43 6f 6e 20 3d |owPtr *)|refCon =|
|00001e50| 20 70 44 69 61 6c 6f 67 | 3b 20 0d 09 09 20 20 20 | pDialog|; ... |
|00001e60| 20 53 65 74 50 6f 72 74 | 28 6f 6c 64 50 6f 72 74 | SetPort|(oldPort|
|00001e70| 29 3b 0d 09 09 20 20 09 | 72 65 74 75 72 6e 20 6e |);... .|return n|
|00001e80| 6f 45 72 72 3b 0d 09 09 | 20 20 7d 0d 09 20 20 20 |oErr;...| }.. |
|00001e90| 20 62 72 65 61 6b 3b 0d | 09 20 20 20 20 63 61 73 | break;.|. cas|
|00001ea0| 65 20 6d 6f 76 69 65 50 | 72 6f 67 72 65 73 73 55 |e movieP|rogressU|
|00001eb0| 70 64 61 74 65 50 65 72 | 63 65 6e 74 3a 0d 09 09 |pdatePer|cent:...|
|00001ec0| 20 20 47 65 74 50 6f 72 | 74 28 26 6f 6c 64 50 6f | GetPor|t(&oldPo|
|00001ed0| 72 74 29 3b 0d 09 09 20 | 20 53 65 74 50 6f 72 74 |rt);... | SetPort|
|00001ee0| 28 2a 28 57 69 6e 64 6f | 77 50 74 72 20 2a 29 72 |(*(Windo|wPtr *)r|
|00001ef0| 65 66 43 6f 6e 29 3b 0d | 09 09 20 20 70 65 72 63 |efCon);.|.. perc|
|00001f00| 65 6e 74 46 69 78 20 3d | 20 46 69 78 4d 75 6c 28 |entFix =| FixMul(|
|00001f10| 70 65 72 63 65 6e 74 2c | 20 70 65 72 63 65 6e 74 |percent,| percent|
|00001f20| 46 69 78 29 3b 0d 09 20 | 20 09 20 20 70 65 72 63 |Fix);.. | . perc|
|00001f30| 65 6e 74 53 68 6f 72 74 | 20 3d 20 46 69 78 52 6f |entShort| = FixRo|
|00001f40| 75 6e 64 28 70 65 72 63 | 65 6e 74 46 69 78 29 3b |und(perc|entFix);|
|00001f50| 0d 09 09 20 20 46 72 61 | 6d 65 52 65 63 74 28 26 |... Fra|meRect(&|
|00001f60| 70 72 6f 67 72 65 73 73 | 52 65 63 74 29 3b 0d 09 |progress|Rect);..|
|00001f70| 09 20 20 49 6e 73 65 74 | 52 65 63 74 28 26 70 72 |. Inset|Rect(&pr|
|00001f80| 6f 67 72 65 73 73 52 65 | 63 74 2c 32 2c 32 29 3b |ogressRe|ct,2,2);|
|00001f90| 0d 09 09 20 20 70 72 6f | 67 72 65 73 73 52 65 63 |... pro|gressRec|
|00001fa0| 74 2e 72 69 67 68 74 20 | 3d 20 70 72 6f 67 72 65 |t.right |= progre|
|00001fb0| 73 73 52 65 63 74 2e 6c | 65 66 74 2b 28 28 70 72 |ssRect.l|eft+((pr|
|00001fc0| 6f 67 72 65 73 73 52 65 | 63 74 2e 72 69 67 68 74 |ogressRe|ct.right|
|00001fd0| 20 2d 20 70 72 6f 67 72 | 65 73 73 52 65 63 74 2e | - progr|essRect.|
|00001fe0| 6c 65 66 74 29 20 2a 20 | 70 65 72 63 65 6e 74 53 |left) * |percentS|
|00001ff0| 68 6f 72 74 2f 31 30 30 | 29 3b 0d 09 09 20 20 50 |hort/100|);... P|
|00002000| 61 69 6e 74 52 65 63 74 | 28 26 70 72 6f 67 72 65 |aintRect|(&progre|
|00002010| 73 73 52 65 63 74 29 3b | 0d 09 09 20 20 53 65 74 |ssRect);|... Set|
|00002020| 50 6f 72 74 28 6f 6c 64 | 50 6f 72 74 29 3b 20 20 |Port(old|Port); |
|00002030| 20 20 20 09 09 09 09 09 | 0d 09 09 20 20 72 65 74 | .....|... ret|
|00002040| 75 72 6e 20 6e 6f 45 72 | 72 3b 0d 09 20 20 20 20 |urn noEr|r;.. |
|00002050| 62 72 65 61 6b 3b 0d 09 | 20 20 20 20 63 61 73 65 |break;..| case|
|00002060| 20 6d 6f 76 69 65 50 72 | 6f 67 72 65 73 73 43 6c | moviePr|ogressCl|
|00002070| 6f 73 65 3a 0d 09 20 20 | 20 20 20 20 44 69 73 70 |ose:.. | Disp|
|00002080| 6f 73 65 57 69 6e 64 6f | 77 28 2a 28 57 69 6e 64 |oseWindo|w(*(Wind|
|00002090| 6f 77 50 74 72 20 2a 29 | 72 65 66 43 6f 6e 29 3b |owPtr *)|refCon);|
|000020a0| 0d 09 09 20 20 72 65 74 | 75 72 6e 20 6e 6f 45 72 |... ret|urn noEr|
|000020b0| 72 3b 0d 09 20 20 20 20 | 62 72 65 61 6b 3b 0d 09 |r;.. |break;..|
|000020c0| 20 20 7d 0d 7d 0d 0d 0d | 2f 2a 20 54 68 65 20 6e | }.}...|/* The n|
|000020d0| 65 78 74 20 70 72 6f 63 | 65 64 75 72 65 73 20 63 |ext proc|edures c|
|000020e0| 6f 6d 65 20 66 72 6f 6d | 20 74 68 65 20 44 54 53 |ome from| the DTS|
|000020f0| 20 73 61 6d 70 6c 65 20 | 4d 61 63 53 68 65 6c 6c | sample |MacShell|
|00002100| 2c 20 63 68 65 63 6b 20 | 69 74 20 6f 75 74 20 66 |, check |it out f|
|00002110| 6f 72 20 6d 6f 72 65 20 | 64 65 74 61 69 6c 73 20 |or more |details |
|00002120| 6f 72 0d 20 20 20 62 65 | 74 74 65 72 20 63 6f 6d |or. be|tter com|
|00002130| 6d 65 6e 74 73 2e 09 4e | 6f 74 65 20 74 68 6f 75 |ments..N|ote thou|
|00002140| 67 68 20 74 68 61 74 20 | 49 20 68 61 76 65 20 6d |gh that |I have m|
|00002150| 6f 64 69 66 69 65 64 20 | 74 68 65 20 63 6f 64 65 |odified |the code|
|00002160| 20 74 6f 20 61 63 63 6f | 6d 6f 64 61 74 65 20 74 | to acco|modate t|
|00002170| 68 65 20 69 6d 6d 65 64 | 69 61 74 65 0d 20 20 20 |he immed|iate. |
|00002180| 6e 65 65 64 73 2c 20 64 | 6f 6e 27 74 20 62 6c 61 |needs, d|on't bla|
|00002190| 6d 65 20 4d 61 63 53 68 | 65 6c 6c 2e 09 09 09 09 |me MacSh|ell.....|
|000021a0| 09 09 09 09 09 2a 2f 0d | 0d 0d 2f 2a 20 63 68 65 |.....*/.|../* che|
|000021b0| 63 6b 73 20 69 73 20 74 | 68 65 20 6d 6f 76 69 65 |cks is t|he movie|
|000021c0| 20 68 61 73 20 74 6f 20 | 62 65 20 73 61 76 65 64 | has to |be saved|
|000021d0| 20 61 6e 64 20 64 65 70 | 65 6e 64 69 6e 67 20 6f | and dep|ending o|
|000021e0| 6e 20 74 68 65 20 63 6f | 6d 6d 61 6e 64 20 74 68 |n the co|mmand th|
|000021f0| 61 74 0d 20 20 20 6f 72 | 69 67 69 6e 61 74 65 64 |at. or|iginated|
|00002200| 20 74 68 65 20 72 65 71 | 75 65 73 74 73 20 73 61 | the req|uests sa|
|00002210| 76 65 73 20 74 68 65 20 | 6d 6f 76 69 65 2e 0d 2a |ves the |movie..*|
|00002220| 2f 20 20 20 0d 20 20 20 | 0d 42 6f 6f 6c 65 61 6e |/ . |.Boolean|
|00002230| 20 53 61 76 65 4d 6f 76 | 69 65 28 20 77 48 6e 64 | SaveMov|ie( wHnd|
|00002240| 6c 2c 20 63 6f 6d 6d 61 | 6e 64 29 0d 44 6f 63 52 |l, comma|nd).DocR|
|00002250| 65 63 48 61 6e 64 6c 65 | 20 77 48 6e 64 6c 3b 0d |ecHandle| wHndl;.|
|00002260| 73 68 6f 72 74 20 63 6f | 6d 6d 61 6e 64 3b 0d 7b |short co|mmand;.{|
|00002270| 0d 09 53 74 72 32 35 35 | 09 09 09 09 63 6c 6f 73 |..Str255|....clos|
|00002280| 65 4f 72 51 75 69 74 3b | 0d 09 73 68 6f 72 74 09 |eOrQuit;|..short.|
|00002290| 09 09 09 69 74 65 6d 3b | 0d 09 53 74 61 6e 64 61 |...item;|..Standa|
|000022a0| 72 64 46 69 6c 65 52 65 | 70 6c 79 09 72 65 70 6c |rdFileRe|ply.repl|
|000022b0| 79 3b 0d 09 4f 53 45 72 | 72 09 09 09 09 65 72 72 |y;..OSEr|r....err|
|000022c0| 3b 0d 09 44 69 61 6c 6f | 67 50 74 72 09 09 09 73 |;..Dialo|gPtr...s|
|000022d0| 61 76 65 44 69 61 6c 6f | 67 3b 0d 0d 09 69 66 20 |aveDialo|g;...if |
|000022e0| 28 63 6f 6d 6d 61 6e 64 | 20 21 3d 20 73 61 76 65 |(command| != save|
|000022f0| 4d 6f 76 69 65 41 73 29 | 20 7b 09 09 09 09 09 09 |MovieAs)| {......|
|00002300| 2f 2a 20 49 66 20 72 65 | 67 75 6c 61 72 20 73 61 |/* If re|gular sa|
|00002310| 76 65 2e 2e 2e 20 2a 2f | 0d 09 09 69 66 20 28 21 |ve... */|...if (!|
|00002320| 48 61 73 4d 6f 76 69 65 | 43 68 61 6e 67 65 64 28 |HasMovie|Changed(|
|00002330| 28 2a 77 48 6e 64 6c 29 | 2d 3e 77 4d 6f 76 69 65 |(*wHndl)|->wMovie|
|00002340| 29 29 09 7b 09 09 2f 2a | 20 49 66 20 6d 6f 76 69 |)).{../*| If movi|
|00002350| 65 20 63 6c 65 61 6e 2e | 2e 2e 20 20 20 2a 2f 0d |e clean.|.. */.|
|00002360| 09 09 20 20 2f 2a 65 78 | 63 65 70 74 20 74 68 61 |.. /*ex|cept tha|
|00002370| 74 20 6c 6f 6f 70 69 6e | 67 20 63 6f 75 6c 64 20 |t loopin|g could |
|00002380| 68 61 76 65 20 63 68 61 | 6e 67 65 64 2e 20 2a 2f |have cha|nged. */|
|00002390| 0d 09 09 20 20 69 66 20 | 28 20 28 2a 77 48 6e 64 |... if |( (*wHnd|
|000023a0| 6c 29 2d 3e 6c 6f 6f 70 | 53 74 61 74 65 20 3d 3d |l)->loop|State ==|
|000023b0| 20 47 65 74 43 75 72 72 | 65 6e 74 4c 6f 6f 70 53 | GetCurr|entLoopS|
|000023c0| 74 61 74 65 28 77 48 6e | 64 6c 29 20 29 0d 09 09 |tate(wHn|dl) )...|
|000023d0| 09 20 20 72 65 74 75 72 | 6e 28 6e 6f 45 72 72 29 |. retur|n(noErr)|
|000023e0| 3b 09 09 09 09 09 09 09 | 09 2f 2a 20 43 6f 6e 73 |;.......|./* Cons|
|000023f0| 69 64 65 72 20 69 74 20 | 73 61 76 65 64 2e 20 2a |ider it |saved. *|
|00002400| 2f 0d 09 09 7d 0d 09 7d | 0d 0d 09 69 66 20 28 28 |/...}..}|...if ((|
|00002410| 63 6f 6d 6d 61 6e 64 20 | 3d 3d 20 63 6c 6f 73 65 |command |== close|
|00002420| 4d 6f 76 69 65 29 20 7c | 7c 20 28 63 6f 6d 6d 61 |Movie) ||| (comma|
|00002430| 6e 64 20 3d 3d 20 71 75 | 69 74 43 6f 6d 6d 61 6e |nd == qu|itComman|
|00002440| 64 29 29 20 7b 0d 09 09 | 2f 2a 20 49 66 20 69 6d |d)) {...|/* If im|
|00002450| 70 6c 69 63 69 74 20 73 | 61 76 65 2e 2e 2e 20 2a |plicit s|ave... *|
|00002460| 2f 0d 0d 09 09 47 65 74 | 49 6e 64 53 74 72 69 6e |/....Get|IndStrin|
|00002470| 67 28 63 6c 6f 73 65 4f | 72 51 75 69 74 2c 20 72 |g(closeO|rQuit, r|
|00002480| 4d 69 73 63 53 74 72 69 | 6e 67 73 2c 0d 09 09 09 |MiscStri|ngs,....|
|00002490| 09 09 20 28 63 6f 6d 6d | 61 6e 64 20 3d 3d 20 63 |.. (comm|and == c|
|000024a0| 6c 6f 73 65 4d 6f 76 69 | 65 29 20 3f 20 73 43 6c |loseMovi|e) ? sCl|
|000024b0| 6f 73 69 6e 67 20 3a 20 | 73 51 75 69 74 74 69 6e |osing : |sQuittin|
|000024c0| 67 29 3b 0d 09 09 50 61 | 72 61 6d 54 65 78 74 28 |g);...Pa|ramText(|
|000024d0| 28 2a 77 48 6e 64 6c 29 | 2d 3e 77 46 69 6c 65 49 |(*wHndl)|->wFileI|
|000024e0| 6e 66 6f 2e 73 66 72 2e | 73 66 46 69 6c 65 2e 6e |nfo.sfr.|sfFile.n|
|000024f0| 61 6d 65 2c 20 63 6c 6f | 73 65 4f 72 51 75 69 74 |ame, clo|seOrQuit|
|00002500| 2c 20 6e 69 6c 2c 20 6e | 69 6c 29 3b 0d 0d 09 09 |, nil, n|il);....|
|00002510| 73 61 76 65 44 69 61 6c | 6f 67 20 3d 20 47 65 74 |saveDial|og = Get|
|00002520| 43 65 6e 74 65 72 65 64 | 44 69 61 6c 6f 67 28 72 |Centered|Dialog(r|
|00002530| 59 65 73 4e 6f 43 61 6e | 63 65 6c 2c 20 6e 69 6c |YesNoCan|cel, nil|
|00002540| 2c 20 28 57 69 6e 64 6f | 77 50 74 72 29 2d 31 4c |, (Windo|wPtr)-1L|
|00002550| 29 3b 0d 0d 09 09 69 66 | 20 28 73 61 76 65 44 69 |);....if| (saveDi|
|00002560| 61 6c 6f 67 29 20 7b 0d | 09 09 09 4f 75 74 6c 69 |alog) {.|...Outli|
|00002570| 6e 65 44 69 61 6c 6f 67 | 49 74 65 6d 28 73 61 76 |neDialog|Item(sav|
|00002580| 65 44 69 61 6c 6f 67 2c | 20 6b 53 61 76 65 59 65 |eDialog,| kSaveYe|
|00002590| 73 29 3b 0d 09 09 09 4d | 6f 64 61 6c 44 69 61 6c |s);....M|odalDial|
|000025a0| 6f 67 28 28 4d 6f 64 61 | 6c 46 69 6c 74 65 72 50 |og((Moda|lFilterP|
|000025b0| 72 6f 63 50 74 72 29 6b | 65 79 45 71 75 69 76 46 |rocPtr)k|eyEquivF|
|000025c0| 69 6c 74 65 72 2c 20 26 | 69 74 65 6d 29 3b 0d 09 |ilter, &|item);..|
|000025d0| 09 09 44 69 73 70 6f 73 | 44 69 61 6c 6f 67 28 73 |..Dispos|Dialog(s|
|000025e0| 61 76 65 44 69 61 6c 6f | 67 29 3b 0d 09 09 7d 0d |aveDialo|g);...}.|
|000025f0| 09 09 65 6c 73 65 0d 09 | 09 09 69 74 65 6d 20 3d |..else..|..item =|
|00002600| 20 6b 53 61 76 65 59 65 | 73 3b 0d 0d 09 09 69 66 | kSaveYe|s;....if|
|00002610| 20 28 69 74 65 6d 20 21 | 3d 20 6b 53 61 76 65 59 | (item !|= kSaveY|
|00002620| 65 73 29 20 7b 0d 09 09 | 09 65 72 72 20 3d 20 6e |es) {...|.err = n|
|00002630| 6f 45 72 72 3b 0d 09 09 | 09 69 66 20 28 69 74 65 |oErr;...|.if (ite|
|00002640| 6d 20 3d 3d 20 6b 53 61 | 76 65 43 61 6e 63 65 6c |m == kSa|veCancel|
|00002650| 65 64 29 20 65 72 72 20 | 3d 20 75 73 65 72 43 61 |ed) err |= userCa|
|00002660| 6e 63 65 6c 65 64 45 72 | 72 3b 0d 09 09 09 72 65 |nceledEr|r;....re|
|00002670| 74 75 72 6e 28 65 72 72 | 29 3b 0d 09 09 7d 0d 09 |turn(err|);...}..|
|00002680| 7d 0d 0d 09 69 66 20 28 | 28 28 63 6f 6d 6d 61 6e |}...if (|((comman|
|00002690| 64 20 3d 3d 20 73 61 76 | 65 4d 6f 76 69 65 41 73 |d == sav|eMovieAs|
|000026a0| 29 20 7c 7c 0d 09 09 28 | 28 2a 77 48 6e 64 6c 29 |) ||...(|(*wHndl)|
|000026b0| 2d 3e 77 46 69 6c 65 49 | 6e 66 6f 2e 73 66 72 2e |->wFileI|nfo.sfr.|
|000026c0| 73 66 46 69 6c 65 2e 76 | 52 65 66 4e 75 6d 20 3d |sfFile.v|RefNum =|
|000026d0| 3d 20 6b 49 6e 76 61 6c | 56 52 65 66 4e 75 6d 29 |= kInval|VRefNum)|
|000026e0| 20 29 29 20 7b 0d 09 09 | 2f 2a 20 50 72 6f 6d 70 | )) {...|/* Promp|
|000026f0| 74 20 77 69 74 68 20 53 | 46 47 65 74 46 69 6c 65 |t with S|FGetFile|
|00002700| 20 69 66 20 64 6f 69 6e | 67 20 61 20 53 61 76 65 | if doin|g a Save|
|00002710| 20 41 73 20 6f 72 20 68 | 61 76 65 20 6e 65 76 65 | As or h|ave neve|
|00002720| 72 20 73 61 76 65 64 20 | 62 65 66 6f 72 65 2e 20 |r saved |before. |
|00002730| 2a 2f 0d 0d 09 09 72 65 | 70 6c 79 20 3d 20 28 2a |*/....re|ply = (*|
|00002740| 77 48 6e 64 6c 29 2d 3e | 77 46 69 6c 65 49 6e 66 |wHndl)->|wFileInf|
|00002750| 6f 2e 73 66 72 3b 0d 09 | 09 0d 09 09 69 66 20 28 |o.sfr;..|....if (|
|00002760| 21 44 69 73 70 6c 61 79 | 50 75 74 46 69 6c 65 28 |!Display|PutFile(|
|00002770| 26 28 72 65 70 6c 79 29 | 29 29 0d 09 09 09 72 65 |&(reply)|))....re|
|00002780| 74 75 72 6e 28 75 73 65 | 72 43 61 6e 63 65 6c 65 |turn(use|rCancele|
|00002790| 64 45 72 72 29 3b 0d 09 | 09 09 09 2f 2a 20 55 73 |dErr);..|.../* Us|
|000027a0| 65 72 20 63 61 6e 63 65 | 6c 65 64 20 74 68 65 20 |er cance|led the |
|000027b0| 73 61 76 65 2e 20 2a 2f | 0d 0d 09 09 69 66 20 28 |save. */|....if (|
|000027c0| 28 2a 77 48 6e 64 6c 29 | 2d 3e 77 46 69 6c 65 49 |(*wHndl)|->wFileI|
|000027d0| 6e 66 6f 2e 73 66 72 2e | 73 66 46 69 6c 65 2e 76 |nfo.sfr.|sfFile.v|
|000027e0| 52 65 66 4e 75 6d 20 21 | 3d 20 6b 49 6e 76 61 6c |RefNum !|= kInval|
|000027f0| 56 52 65 66 4e 75 6d 29 | 20 7b 0d 09 09 09 69 66 |VRefNum)| {....if|
|00002800| 20 28 65 72 72 20 3d 20 | 43 6c 6f 73 65 4d 6f 76 | (err = |CloseMov|
|00002810| 69 65 46 69 6c 65 28 28 | 2a 77 48 6e 64 6c 29 2d |ieFile((|*wHndl)-|
|00002820| 3e 77 46 69 6c 65 49 6e | 66 6f 2e 72 65 73 46 69 |>wFileIn|fo.resFi|
|00002830| 6c 65 29 20 29 0d 09 09 | 09 20 20 44 65 62 75 67 |le) )...|. Debug|
|00002840| 53 74 72 28 22 5c 70 43 | 6c 6f 73 65 4d 6f 76 69 |Str("\pC|loseMovi|
|00002850| 65 46 69 6c 65 20 66 61 | 69 6c 65 64 20 69 6e 20 |eFile fa|iled in |
|00002860| 53 61 76 65 4d 6f 76 69 | 65 22 29 3b 20 0d 09 09 |SaveMovi|e"); ...|
|00002870| 09 09 2f 2a 20 43 6c 6f | 73 65 20 74 68 65 20 6f |../* Clo|se the o|
|00002880| 6c 64 20 66 69 6c 65 2e | 20 20 44 6f 6e 27 74 20 |ld file.| Don't |
|00002890| 72 65 73 70 6f 6e 64 20 | 74 6f 20 61 6e 79 20 65 |respond |to any e|
|000028a0| 72 72 6f 72 20 68 65 72 | 65 20 62 65 63 61 75 73 |rror her|e becaus|
|000028b0| 65 0d 09 09 09 09 2a 2a | 20 74 68 65 20 75 73 65 |e.....**| the use|
|000028c0| 72 20 6d 61 79 20 62 65 | 20 74 72 79 69 6e 67 20 |r may be| trying |
|000028d0| 74 6f 20 64 6f 20 61 20 | 73 61 76 65 2d 61 73 20 |to do a |save-as |
|000028e0| 62 65 63 61 75 73 65 20 | 74 68 65 69 72 20 6f 6c |because |their ol|
|000028f0| 64 20 66 69 6c 65 0d 09 | 09 09 09 2a 2a 20 69 73 |d file..|...** is|
|00002900| 20 62 61 64 2e 20 20 49 | 66 20 77 65 20 66 61 69 | bad. I|f we fai|
|00002910| 6c 20 74 6f 20 63 6c 6f | 73 65 20 74 68 65 20 6f |l to clo|se the o|
|00002920| 6c 64 20 66 69 6c 65 2c | 20 61 6e 64 20 74 68 65 |ld file,| and the|
|00002930| 6e 20 72 65 73 70 6f 6e | 64 0d 09 09 09 09 2a 2a |n respon|d.....**|
|00002940| 20 74 6f 20 74 68 65 20 | 65 72 72 6f 72 2c 20 74 | to the |error, t|
|00002950| 68 65 20 75 73 65 72 20 | 77 6f 6e 27 74 20 67 65 |he user |won't ge|
|00002960| 74 20 74 68 65 20 6f 70 | 70 6f 72 74 75 6e 69 74 |t the op|portunit|
|00002970| 79 20 74 6f 20 73 61 76 | 65 0d 09 09 09 09 2a 2a |y to sav|e.....**|
|00002980| 20 74 68 65 69 72 20 64 | 6f 63 75 6d 65 6e 74 20 | their d|ocument |
|00002990| 74 6f 20 61 20 6e 65 77 | 20 66 69 6c 65 2e 0d 09 |to a new| file...|
|000029a0| 09 09 09 2a 2f 0d 09 09 | 7d 0d 09 09 53 65 74 57 |...*/...|}...SetW|
|000029b0| 54 69 74 6c 65 28 46 72 | 6f 6e 74 57 69 6e 64 6f |Title(Fr|ontWindo|
|000029c0| 77 28 29 2c 72 65 70 6c | 79 2e 73 66 46 69 6c 65 |w(),repl|y.sfFile|
|000029d0| 2e 6e 61 6d 65 29 3b 0d | 09 09 28 2a 77 48 6e 64 |.name);.|..(*wHnd|
|000029e0| 6c 29 2d 3e 77 46 69 6c | 65 49 6e 66 6f 2e 73 66 |l)->wFil|eInfo.sf|
|000029f0| 72 20 3d 20 72 65 70 6c | 79 3b 0d 09 09 69 66 20 |r = repl|y;...if |
|00002a00| 28 20 65 72 72 20 3d 20 | 50 75 74 4d 6f 76 69 65 |( err = |PutMovie|
|00002a10| 54 6f 46 69 6c 65 28 77 | 48 6e 64 6c 2c 20 74 72 |ToFile(w|Hndl, tr|
|00002a20| 75 65 29 20 29 20 7b 0d | 09 09 20 20 72 65 70 6c |ue) ) {.|.. repl|
|00002a30| 79 2e 73 66 46 69 6c 65 | 2e 76 52 65 66 4e 75 6d |y.sfFile|.vRefNum|
|00002a40| 20 3d 20 6b 49 6e 76 61 | 6c 56 52 65 66 4e 75 6d | = kInva|lVRefNum|
|00002a50| 3b 0d 09 09 20 20 44 65 | 62 75 67 53 74 72 28 22 |;... De|bugStr("|
|00002a60| 5c 70 43 6f 75 6c 64 6e | 27 74 20 63 72 65 61 74 |\pCouldn|'t creat|
|00002a70| 65 20 74 68 65 20 6e 65 | 77 20 66 69 6c 65 20 66 |e the ne|w file f|
|00002a80| 6f 72 20 73 61 76 65 20 | 61 73 22 29 3b 0d 09 09 |or save |as");...|
|00002a90| 7d 0d 09 7d 0d 09 65 6c | 73 65 20 2f 2a 20 73 61 |}..}..el|se /* sa|
|00002aa0| 76 69 6e 67 20 69 6e 74 | 6f 20 61 6e 20 65 78 69 |ving int|o an exi|
|00002ab0| 73 74 69 6e 67 20 66 69 | 6c 65 20 2a 2f 0d 09 20 |sting fi|le */.. |
|00002ac0| 20 69 66 20 28 65 72 72 | 20 3d 20 50 75 74 4d 6f | if (err| = PutMo|
|00002ad0| 76 69 65 54 6f 46 69 6c | 65 28 77 48 6e 64 6c 2c |vieToFil|e(wHndl,|
|00002ae0| 20 66 61 6c 73 65 29 20 | 29 20 7b 0d 09 09 28 2a | false) |) {...(*|
|00002af0| 77 48 6e 64 6c 29 2d 3e | 77 46 69 6c 65 49 6e 66 |wHndl)->|wFileInf|
|00002b00| 6f 2e 73 66 72 2e 73 66 | 46 69 6c 65 2e 76 52 65 |o.sfr.sf|File.vRe|
|00002b10| 66 4e 75 6d 20 3d 20 6b | 49 6e 76 61 6c 56 52 65 |fNum = k|InvalVRe|
|00002b20| 66 4e 75 6d 3b 0d 09 09 | 72 65 74 75 72 6e 28 65 |fNum;...|return(e|
|00002b30| 72 72 29 3b 0d 09 20 20 | 7d 0d 09 0d 09 43 6c 65 |rr);.. |}....Cle|
|00002b40| 61 72 4d 6f 76 69 65 43 | 68 61 6e 67 65 64 28 28 |arMovieC|hanged((|
|00002b50| 2a 77 48 6e 64 6c 29 2d | 3e 77 4d 6f 76 69 65 29 |*wHndl)-|>wMovie)|
|00002b60| 3b 0d 09 72 65 74 75 72 | 6e 28 6e 6f 45 72 72 29 |;..retur|n(noErr)|
|00002b70| 3b 0d 7d 0d 0d 0d 4f 53 | 45 72 72 20 50 75 74 4d |;.}...OS|Err PutM|
|00002b80| 6f 76 69 65 54 6f 46 69 | 6c 65 28 77 48 6e 64 6c |ovieToFi|le(wHndl|
|00002b90| 2c 20 6e 65 77 46 69 6c | 65 29 0d 44 6f 63 52 65 |, newFil|e).DocRe|
|00002ba0| 63 48 61 6e 64 6c 65 09 | 77 48 6e 64 6c 3b 0d 42 |cHandle.|wHndl;.B|
|00002bb0| 6f 6f 6c 65 61 6e 09 09 | 09 6e 65 77 46 69 6c 65 |oolean..|.newFile|
|00002bc0| 3b 0d 7b 0d 4f 53 45 72 | 72 20 74 68 65 45 72 72 |;.{.OSEr|r theErr|
|00002bd0| 3b 0d 73 68 6f 72 74 09 | 72 65 73 46 69 6c 65 2c |;.short.|resFile,|
|00002be0| 20 0d 09 09 72 65 73 49 | 44 20 3d 20 30 3b 20 2f | ...resI|D = 0; /|
|00002bf0| 2a 20 72 65 73 6f 75 72 | 63 65 20 69 64 20 3d 20 |* resour|ce id = |
|00002c00| 30 20 74 65 6c 6c 73 20 | 74 68 65 20 4d 6f 76 69 |0 tells |the Movi|
|00002c10| 65 54 6f 6f 6c 62 6f 78 | 20 74 6f 20 63 6f 6d 65 |eToolbox| to come|
|00002c20| 20 75 70 20 77 69 74 68 | 20 61 20 6e 75 6d 62 65 | up with| a numbe|
|00002c30| 72 20 2a 2f 0d 44 69 61 | 6c 6f 67 50 74 72 20 66 |r */.Dia|logPtr f|
|00002c40| 6c 61 74 74 65 6e 44 69 | 61 6c 6f 67 3b 20 09 2f |lattenDi|alog; ./|
|00002c50| 2a 20 74 68 65 20 70 72 | 6f 67 72 65 73 73 20 70 |* the pr|ogress p|
|00002c60| 72 6f 63 20 73 74 6f 72 | 65 73 20 68 65 72 65 20 |roc stor|es here |
|00002c70| 69 74 73 20 64 69 61 6c | 6f 67 20 70 6f 69 6e 74 |its dial|og point|
|00002c80| 65 72 20 2a 2f 0d 0d 09 | 2f 2a 20 77 65 20 61 72 |er */...|/* we ar|
|00002c90| 65 20 61 62 6f 75 74 20 | 74 6f 20 73 61 76 65 20 |e about |to save |
|00002ca0| 74 68 65 20 66 69 6c 65 | 20 74 68 69 73 20 69 73 |the file| this is|
|00002cb0| 20 61 20 67 6f 6f 64 20 | 74 69 6d 65 20 74 6f 20 | a good |time to |
|00002cc0| 75 70 64 61 74 65 20 74 | 68 65 20 6c 6f 6f 70 20 |update t|he loop |
|00002cd0| 73 74 61 74 65 20 62 6f | 74 68 0d 09 20 20 20 69 |state bo|th.. i|
|00002ce0| 6e 20 6d 65 6d 6f 72 79 | 20 61 6e 64 20 69 6e 20 |n memory| and in |
|00002cf0| 74 68 65 20 66 69 6c 65 | 2e 0d 09 20 20 20 0d 09 |the file|... ..|
|00002d00| 2a 2f 0d 09 0d 09 55 70 | 64 61 74 65 4c 6f 6f 70 |*/....Up|dateLoop|
|00002d10| 53 74 61 74 65 49 6e 66 | 6f 28 77 48 6e 64 6c 29 |StateInf|o(wHndl)|
|00002d20| 3b 0d 09 0d 09 55 70 64 | 61 74 65 57 69 6e 64 6f |;....Upd|ateWindo|
|00002d30| 77 50 6f 73 28 29 3b 0d | 09 0d 09 72 65 73 46 69 |wPos();.|...resFi|
|00002d40| 6c 65 20 3d 20 43 75 72 | 52 65 73 46 69 6c 65 28 |le = Cur|ResFile(|
|00002d50| 29 3b 0d 09 69 66 20 28 | 6e 65 77 46 69 6c 65 29 |);..if (|newFile)|
|00002d60| 20 7b 0d 09 20 20 69 66 | 20 28 20 67 46 6c 61 74 | {.. if| ( gFlat|
|00002d70| 74 65 6e 4d 6f 76 69 65 | 73 29 20 7b 0d 09 20 20 |tenMovie|s) {.. |
|00002d80| 0d 09 20 20 09 2f 2a 20 | 42 72 61 63 6b 65 74 74 |.. ./* |Brackett|
|00002d90| 20 46 6c 61 74 74 65 6e | 20 6d 6f 76 69 65 20 77 | Flatten| movie w|
|00002da0| 69 74 68 20 53 65 74 4d | 6f 76 69 65 50 72 6f 67 |ith SetM|ovieProg|
|00002db0| 72 65 73 73 20 70 72 6f | 63 20 63 61 6c 6c 73 20 |ress pro|c calls |
|00002dc0| 73 6f 20 74 68 61 74 20 | 74 68 65 20 75 73 65 72 |so that |the user|
|00002dd0| 0d 09 09 20 20 20 67 65 | 74 73 20 74 6f 20 6b 6e |... ge|ts to kn|
|00002de0| 6f 77 20 77 68 61 74 20 | 69 73 20 67 6f 69 6e 67 |ow what |is going|
|00002df0| 20 6f 6e 20 69 66 20 74 | 68 65 20 66 6c 61 74 74 | on if t|he flatt|
|00002e00| 65 6e 69 6e 67 20 74 61 | 6b 65 73 20 74 6f 6f 20 |ening ta|kes too |
|00002e10| 6c 6f 6e 67 2e 0d 09 09 | 20 20 20 49 74 20 69 73 |long....| It is|
|00002e20| 20 61 6c 73 6f 20 69 6d | 70 6f 72 74 61 6e 74 20 | also im|portant |
|00002e30| 74 6f 20 6c 6f 63 6b 20 | 74 68 65 20 68 61 6e 64 |to lock |the hand|
|00002e40| 6c 65 20 63 6f 6e 74 61 | 69 6e 69 6e 67 20 74 68 |le conta|ining th|
|00002e50| 65 20 6d 6f 76 69 65 20 | 72 65 66 65 72 65 6e 63 |e movie |referenc|
|00002e60| 65 2c 0d 09 09 20 20 20 | 46 6c 61 74 74 65 6e 4d |e,... |FlattenM|
|00002e70| 6f 76 69 65 20 6d 6f 76 | 65 73 20 64 61 74 61 20 |ovie mov|es data |
|00002e80| 61 72 6f 75 6e 64 20 61 | 6e 64 20 73 69 6e 63 65 |around a|nd since|
|00002e90| 20 77 65 20 61 72 65 20 | 64 65 72 65 66 65 72 65 | we are |derefere|
|00002ea0| 6e 63 69 6e 67 20 74 68 | 65 20 68 61 6e 64 6c 65 |ncing th|e handle|
|00002eb0| 0d 09 09 20 20 20 74 68 | 65 20 70 6f 69 6e 74 65 |... th|e pointe|
|00002ec0| 72 20 77 65 20 70 61 73 | 73 20 63 6f 75 6c 64 20 |r we pas|s could |
|00002ed0| 65 6e 64 20 75 70 20 70 | 6f 69 6e 74 69 6e 67 20 |end up p|ointing |
|00002ee0| 74 6f 20 67 61 72 62 61 | 67 65 2e 0d 09 09 2a 2f |to garba|ge....*/|
|00002ef0| 0d 09 09 48 4c 6f 63 6b | 28 28 48 61 6e 64 6c 65 |...HLock|((Handle|
|00002f00| 29 77 48 6e 64 6c 29 3b | 0d 09 09 53 65 74 4d 6f |)wHndl);|...SetMo|
|00002f10| 76 69 65 50 72 6f 67 72 | 65 73 73 50 72 6f 63 28 |vieProgr|essProc(|
|00002f20| 28 2a 77 48 6e 64 6c 29 | 2d 3e 77 4d 6f 76 69 65 |(*wHndl)|->wMovie|
|00002f30| 2c 20 66 6c 61 74 74 65 | 6e 50 72 6f 67 72 65 73 |, flatte|nProgres|
|00002f40| 73 50 72 6f 63 2c 20 28 | 6c 6f 6e 67 29 20 26 66 |sProc, (|long) &f|
|00002f50| 6c 61 74 74 65 6e 44 69 | 61 6c 6f 67 29 3b 0d 0d |lattenDi|alog);..|
|00002f60| 09 20 20 20 20 46 6c 61 | 74 74 65 6e 4d 6f 76 69 |. Fla|ttenMovi|
|00002f70| 65 28 28 2a 77 48 6e 64 | 6c 29 2d 3e 77 4d 6f 76 |e((*wHnd|l)->wMov|
|00002f80| 69 65 2c 20 30 20 2f 2a | 20 66 6c 61 67 73 20 2a |ie, 0 /*| flags *|
|00002f90| 2f 2c 20 0d 09 09 20 20 | 20 20 20 20 20 20 20 20 |/, ... | |
|00002fa0| 20 20 20 26 28 28 2a 77 | 48 6e 64 6c 29 2d 3e 77 | &((*w|Hndl)->w|
|00002fb0| 46 69 6c 65 49 6e 66 6f | 2e 73 66 72 2e 73 66 46 |FileInfo|.sfr.sfF|
|00002fc0| 69 6c 65 29 2c 20 27 54 | 56 4f 44 27 2c 30 2c 0d |ile), 'T|VOD',0,.|
|00002fd0| 09 09 09 09 09 20 63 72 | 65 61 74 65 4d 6f 76 69 |..... cr|eateMovi|
|00002fe0| 65 46 69 6c 65 44 65 6c | 65 74 65 43 75 72 46 69 |eFileDel|eteCurFi|
|00002ff0| 6c 65 20 2f 2a 20 63 72 | 65 61 74 65 4d 6f 76 69 |le /* cr|eateMovi|
|00003000| 65 46 69 6c 65 46 6c 61 | 67 73 2a 2f 2c 0d 09 09 |eFileFla|gs*/,...|
|00003010| 09 09 09 20 20 26 72 65 | 73 49 44 2c 20 6e 69 6c |... &re|sID, nil|
|00003020| 20 2f 2a 20 72 65 73 4e | 61 6d 65 20 2a 2f 29 3b | /* resN|ame */);|
|00003030| 0d 0d 09 09 48 55 6e 6c | 6f 63 6b 28 28 48 61 6e |....HUnl|ock((Han|
|00003040| 64 6c 65 29 77 48 6e 64 | 6c 29 3b 0d 09 09 69 66 |dle)wHnd|l);...if|
|00003050| 20 28 74 68 65 45 72 72 | 20 3d 20 47 65 74 4d 6f | (theErr| = GetMo|
|00003060| 76 69 65 73 45 72 72 6f | 72 28 29 29 0d 09 09 20 |viesErro|r())... |
|00003070| 20 44 65 62 75 67 53 74 | 72 28 22 5c 70 46 6c 61 | DebugSt|r("\pFla|
|00003080| 74 74 65 6e 4d 6f 76 69 | 65 20 66 61 69 6c 65 64 |ttenMovi|e failed|
|00003090| 22 29 3b 0d 09 09 65 6c | 73 65 0d 09 09 20 20 28 |");...el|se... (|
|000030a0| 2a 77 48 6e 64 6c 29 2d | 3e 77 46 69 6c 65 49 6e |*wHndl)-|>wFileIn|
|000030b0| 66 6f 2e 6d 6f 6f 76 49 | 44 20 3d 20 72 65 73 49 |fo.moovI|D = resI|
|000030c0| 44 3b 09 09 2f 2a 20 72 | 65 6d 65 6d 62 65 72 20 |D;../* r|emember |
|000030d0| 74 68 65 20 6d 6f 6f 76 | 20 72 65 73 6f 75 72 63 |the moov| resourc|
|000030e0| 65 20 69 64 20 2a 2f 0d | 0d 09 09 53 65 74 4d 6f |e id */.|...SetMo|
|000030f0| 76 69 65 50 72 6f 67 72 | 65 73 73 50 72 6f 63 28 |vieProgr|essProc(|
|00003100| 28 2a 77 48 6e 64 6c 29 | 2d 3e 77 4d 6f 76 69 65 |(*wHndl)|->wMovie|
|00003110| 2c 20 6e 69 6c 2c 20 30 | 29 3b 20 2f 2a 20 66 6c |, nil, 0|); /* fl|
|00003120| 61 74 74 65 6e 69 6e 67 | 20 69 73 20 64 6f 6e 65 |attening| is done|
|00003130| 20 72 65 6d 6f 76 65 20 | 70 72 6f 63 20 2a 2f 0d | remove |proc */.|
|00003140| 0d 09 09 69 66 20 28 74 | 68 65 45 72 72 20 3d 20 |...if (t|heErr = |
|00003150| 4f 70 65 6e 4d 6f 76 69 | 65 46 69 6c 65 28 20 26 |OpenMovi|eFile( &|
|00003160| 28 28 2a 77 48 6e 64 6c | 29 2d 3e 77 46 69 6c 65 |((*wHndl|)->wFile|
|00003170| 49 6e 66 6f 2e 73 66 72 | 2e 73 66 46 69 6c 65 29 |Info.sfr|.sfFile)|
|00003180| 2c 0d 09 09 20 20 20 20 | 20 20 20 20 20 20 20 20 |,... | |
|00003190| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000031a0| 26 28 28 2a 77 48 6e 64 | 6c 29 2d 3e 77 46 69 6c |&((*wHnd|l)->wFil|
|000031b0| 65 49 6e 66 6f 2e 72 65 | 73 46 69 6c 65 29 2c 66 |eInfo.re|sFile),f|
|000031c0| 73 52 64 57 72 50 65 72 | 6d 29 29 0d 09 09 20 20 |sRdWrPer|m))... |
|000031d0| 44 65 62 75 67 53 74 72 | 28 22 5c 70 4f 70 65 6e |DebugStr|("\pOpen|
|000031e0| 4d 6f 76 69 65 46 69 6c | 65 20 66 61 69 6c 65 64 |MovieFil|e failed|
|000031f0| 22 29 3b 0d 09 20 20 7d | 0d 09 20 20 65 6c 73 65 |");.. }|.. else|
|00003200| 20 2f 2a 20 64 6f 20 6e | 6f 74 20 66 6c 61 74 74 | /* do n|ot flatt|
|00003210| 65 6e 20 2a 2f 0d 09 20 | 20 20 20 7b 0d 09 09 20 |en */.. | {... |
|00003220| 20 69 66 20 28 20 21 28 | 74 68 65 45 72 72 20 3d | if ( !(|theErr =|
|00003230| 20 43 72 65 61 74 65 4d | 6f 76 69 65 46 69 6c 65 | CreateM|ovieFile|
|00003240| 28 20 20 26 28 28 2a 77 | 48 6e 64 6c 29 2d 3e 77 |( &((*w|Hndl)->w|
|00003250| 46 69 6c 65 49 6e 66 6f | 2e 73 66 72 2e 73 66 46 |FileInfo|.sfr.sfF|
|00003260| 69 6c 65 29 2c 20 27 54 | 56 4f 44 27 2c 30 2c 63 |ile), 'T|VOD',0,c|
|00003270| 72 65 61 74 65 4d 6f 76 | 69 65 46 69 6c 65 44 65 |reateMov|ieFileDe|
|00003280| 6c 65 74 65 43 75 72 46 | 69 6c 65 2c 20 0d 09 09 |leteCurF|ile, ...|
|00003290| 09 09 09 09 09 09 09 20 | 26 28 28 2a 77 48 6e 64 |....... |&((*wHnd|
|000032a0| 6c 29 2d 3e 77 46 69 6c | 65 49 6e 66 6f 2e 72 65 |l)->wFil|eInfo.re|
|000032b0| 73 46 69 6c 65 29 2c 20 | 6e 69 6c 29 20 29 29 20 |sFile), |nil) )) |
|000032c0| 7b 0d 09 09 09 69 66 20 | 28 74 68 65 45 72 72 20 |{....if |(theErr |
|000032d0| 3d 20 41 64 64 4d 6f 76 | 69 65 52 65 73 6f 75 72 |= AddMov|ieResour|
|000032e0| 63 65 28 28 2a 77 48 6e | 64 6c 29 2d 3e 77 4d 6f |ce((*wHn|dl)->wMo|
|000032f0| 76 69 65 2c 20 28 2a 77 | 48 6e 64 6c 29 2d 3e 77 |vie, (*w|Hndl)->w|
|00003300| 46 69 6c 65 49 6e 66 6f | 2e 72 65 73 46 69 6c 65 |FileInfo|.resFile|
|00003310| 2c 20 0d 09 09 09 09 09 | 09 09 09 09 09 26 72 65 |, ......|.....&re|
|00003320| 73 49 44 2c 20 6e 69 6c | 20 2f 2a 20 72 65 73 4e |sID, nil| /* resN|
|00003330| 61 6d 65 20 2a 2f 29 20 | 29 0d 09 09 09 20 20 44 |ame */) |).... D|
|00003340| 65 62 75 67 53 74 72 28 | 22 5c 70 41 64 64 4d 6f |ebugStr(|"\pAddMo|
|00003350| 76 69 65 52 65 73 6f 75 | 72 63 65 20 66 61 69 6c |vieResou|rce fail|
|00003360| 65 64 20 69 6e 20 50 75 | 74 4d 6f 76 69 65 54 6f |ed in Pu|tMovieTo|
|00003370| 46 69 6c 65 22 29 3b 0d | 09 09 09 65 6c 73 65 0d |File");.|...else.|
|00003380| 09 09 20 20 20 20 20 28 | 2a 77 48 6e 64 6c 29 2d |.. (|*wHndl)-|
|00003390| 3e 77 46 69 6c 65 49 6e | 66 6f 2e 6d 6f 6f 76 49 |>wFileIn|fo.moovI|
|000033a0| 44 20 3d 20 72 65 73 49 | 44 3b 09 09 2f 2a 20 72 |D = resI|D;../* r|
|000033b0| 65 6d 65 6d 62 65 72 20 | 74 68 65 20 6d 6f 6f 76 |emember |the moov|
|000033c0| 20 72 65 73 6f 75 72 63 | 65 20 69 64 20 2a 2f 0d | resourc|e id */.|
|000033d0| 09 09 20 20 7d 0d 09 09 | 20 20 65 6c 73 65 20 44 |.. }...| else D|
|000033e0| 65 62 75 67 53 74 72 28 | 22 5c 70 43 72 65 61 74 |ebugStr(|"\pCreat|
|000033f0| 65 4d 6f 76 69 65 46 69 | 6c 65 20 46 61 69 6c 65 |eMovieFi|le Faile|
|00003400| 64 20 69 6e 20 50 75 74 | 4d 6f 76 69 65 54 6f 46 |d in Put|MovieToF|
|00003410| 69 6c 65 22 29 3b 0d 09 | 20 20 20 20 7d 0d 09 7d |ile");..| }..}|
|00003420| 0d 09 65 6c 73 65 20 0d | 09 20 20 69 66 20 28 74 |..else .|. if (t|
|00003430| 68 65 45 72 72 20 3d 20 | 55 70 64 61 74 65 4d 6f |heErr = |UpdateMo|
|00003440| 76 69 65 52 65 73 6f 75 | 72 63 65 28 20 28 2a 77 |vieResou|rce( (*w|
|00003450| 48 6e 64 6c 29 2d 3e 77 | 4d 6f 76 69 65 2c 20 28 |Hndl)->w|Movie, (|
|00003460| 2a 77 48 6e 64 6c 29 2d | 3e 77 46 69 6c 65 49 6e |*wHndl)-|>wFileIn|
|00003470| 66 6f 2e 72 65 73 46 69 | 6c 65 2c 20 0d 09 09 09 |fo.resFi|le, ....|
|00003480| 09 09 09 09 20 20 20 20 | 20 20 20 20 28 2a 77 48 |.... | (*wH|
|00003490| 6e 64 6c 29 2d 3e 77 46 | 69 6c 65 49 6e 66 6f 2e |ndl)->wF|ileInfo.|
|000034a0| 6d 6f 6f 76 49 44 2c 20 | 6e 69 6c 29 29 0d 09 20 |moovID, |nil)).. |
|000034b0| 20 20 20 44 65 62 75 67 | 53 74 72 28 22 5c 70 50 | Debug|Str("\pP|
|000034c0| 75 74 4d 6f 76 69 65 54 | 6f 46 69 6c 65 3a 20 55 |utMovieT|oFile: U|
|000034d0| 70 64 61 74 65 4d 6f 76 | 69 65 52 65 73 6f 75 72 |pdateMov|ieResour|
|000034e0| 63 65 20 66 61 69 6c 65 | 64 22 29 3b 0d 0d 09 55 |ce faile|d");...U|
|000034f0| 73 65 52 65 73 46 69 6c | 65 28 72 65 73 46 69 6c |seResFil|e(resFil|
|00003500| 65 29 3b 0d 09 72 65 74 | 75 72 6e 20 28 74 68 65 |e);..ret|urn (the|
|00003510| 45 72 72 29 3b 0d 7d 00 | 00 00 00 00 00 00 00 00 |Err);.}.|........|
|00003520| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003530| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003540| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003550| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003570| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003580| 00 00 01 00 00 00 01 6e | 00 00 00 6e 00 00 00 3e |.......n|...n...>|
|00003590| 00 00 23 73 17 52 4c 45 | 20 43 6f 64 65 63 20 52 |..#s.RLE| Codec R|
|000035a0| 65 6c 65 61 73 65 20 4e | 6f 74 65 73 02 00 00 00 |elease N|otes....|
|000035b0| 11 53 69 6d 70 6c 65 49 | 6e 57 69 6e 64 6f 77 73 |.SimpleI|nWindows|
|000035c0| 2e 63 02 00 00 00 54 45 | 58 54 4d 50 53 20 01 00 |.c....TE|XTMPS ..|
|000035d0| 00 00 54 45 58 54 4d 50 | 53 20 01 00 00 1c 00 ea |..TEXTMP|S ......|
|000035e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000035f0| 00 00 a4 c5 b7 87 00 00 | 34 97 00 00 01 ac 00 00 |........|4.......|
|00003600| 00 00 37 77 00 01 00 00 | 00 00 00 00 00 00 00 00 |..7w....|........|
|00003610| 00 00 21 00 00 00 23 73 | 1b 54 68 69 6e 67 20 4d |..!...#s|.Thing M|
|00003620| 61 6e 61 67 65 72 20 52 | 65 6c 65 61 73 65 20 4e |anager R|elease N|
|00003630| 6f 74 65 73 02 00 00 00 | 54 45 58 54 4d 50 53 20 |otes....|TEXTMPS |
|00003640| 01 00 00 00 00 00 00 00 | 00 00 23 78 00 00 00 00 |........|..#x....|
|00003650| 0a ca 00 00 0c 00 00 00 | 00 00 01 5d 00 00 06 00 |........|...]....|
|00003660| a4 c5 91 40 a4 c5 91 40 | 00 75 ea 14 19 aa 00 00 |...@...@|.u......|
|00003670| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 37 78 |........|......7x|
|00003680| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 77 20 74 |...H..Mo|naco.w t|
|00003690| 6f 20 6f 70 65 6e 20 61 | 6e 64 20 64 69 73 70 6c |o open a|nd displ|
|000036a0| 61 79 0d 51 75 69 00 06 | 00 04 00 42 00 0f 03 55 |ay.Qui..|...B...U|
|000036b0| 02 95 00 42 00 0f 03 55 | 02 95 a6 fb 0f bc 00 00 |...B...U|........|
|000036c0| 20 4b 00 00 20 4b 00 00 | 00 00 01 00 00 00 00 1e | K.. K..|........|
|000036d0| 00 42 00 0f 03 55 02 95 | 00 42 00 0f 03 55 02 95 |.B...U..|.B...U..|
|000036e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000036f0| 01 00 00 00 01 6e 00 00 | 00 6e 00 00 00 3e 00 bf |.....n..|.n...>..|
|00003700| a0 74 0d 98 00 00 00 1c | 00 3e 00 00 4d 50 53 52 |.t......|.>..MPSR|
|00003710| 00 01 00 0a 03 ed ff ff | 00 00 00 00 00 00 00 00 |........|........|
|00003720| 03 f0 ff ff 00 00 00 4c | 00 c1 9d 64 00 00 00 00 |.......L|...d....|
|00003730| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003740| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003750| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+